/device/google/cuttlefish/common/libs/fs/ |
D | shared_fd.h | 128 class SharedFD { 132 inline SharedFD(); 133 SharedFD(const std::shared_ptr<FileInstance>& in) : value_(in) {} in SharedFD() function 134 SharedFD(SharedFD const&) = default; 135 SharedFD(SharedFD&& other); 136 SharedFD& operator=(SharedFD const&) = default; 137 SharedFD& operator=(SharedFD&& other); 139 static SharedFD Accept(const FileInstance& listener, struct sockaddr* addr, 141 static SharedFD Accept(const FileInstance& listener); 142 static SharedFD Dup(int unmanaged_fd); [all …]
|
D | shared_fd.cpp | 327 SharedFD::SharedFD(SharedFD&& other) { in SharedFD() function in cuttlefish::SharedFD 332 SharedFD& SharedFD::operator=(SharedFD&& other) { in operator =() 338 int SharedFD::Poll(std::vector<PollSharedFd>& fds, int timeout) { in Poll() 342 int SharedFD::Poll(PollSharedFd* fds, size_t num_fds, int timeout) { in Poll() 382 SharedFD SharedFD::Accept(const FileInstance& listener, struct sockaddr* addr, in Accept() 384 return SharedFD( in Accept() 388 SharedFD SharedFD::Accept(const FileInstance& listener) { in Accept() 389 return SharedFD::Accept(listener, NULL, NULL); in Accept() 392 SharedFD SharedFD::Dup(int unmanaged_fd) { in Dup() 395 return SharedFD(std::shared_ptr<FileInstance>(new FileInstance(fd, error_num))); in Dup() [all …]
|
D | shared_buf.h | 35 ssize_t ReadAll(SharedFD fd, std::string* buf); 50 ssize_t ReadExact(SharedFD fd, std::string* buf); 65 ssize_t ReadExact(SharedFD fd, std::vector<char>* buf); 80 ssize_t ReadExact(SharedFD fd, char* buf, size_t size); 91 ssize_t ReadExactBinary(SharedFD fd, T* binary_data) { in ReadExactBinary() 109 ssize_t WriteAll(SharedFD fd, std::string_view buf); 125 ssize_t WriteAll(SharedFD fd, const std::vector<char>& buf); 141 ssize_t WriteAll(SharedFD fd, const char* buf, size_t size); 158 ssize_t WriteAllBinary(SharedFD fd, const T* binary_data) { in WriteAllBinary() 170 bool SendAll(SharedFD sock, std::string_view msg); [all …]
|
D | epoll.h | 32 SharedFD fd; 43 Result<void> Add(SharedFD fd, uint32_t events); 44 Result<void> Modify(SharedFD fd, uint32_t events); 45 Result<void> AddOrModify(SharedFD fd, uint32_t events); 46 Result<void> Delete(SharedFD fd); 50 Epoll(SharedFD); 62 SharedFD epoll_fd_; 68 std::set<SharedFD> watched_;
|
D | shared_buf.cc | 33 ssize_t WriteAll(SharedFD fd, const char* buf, size_t size) { in WriteAll() 50 ssize_t ReadExact(SharedFD fd, char* buf, size_t size) { in ReadExact() 67 ssize_t ReadAll(SharedFD fd, std::string* buf) { in ReadAll() 83 ssize_t ReadExact(SharedFD fd, std::string* buf) { in ReadExact() 87 ssize_t ReadExact(SharedFD fd, std::vector<char>* buf) { in ReadExact() 91 ssize_t WriteAll(SharedFD fd, std::string_view buf) { in WriteAll() 95 ssize_t WriteAll(SharedFD fd, const std::vector<char>& buf) { in WriteAll() 99 bool SendAll(SharedFD sock, std::string_view msg) { in SendAll() 115 std::string RecvAll(SharedFD sock, const size_t count) { in RecvAll()
|
D | shared_select.h | 38 typedef std::set<SharedFD>::iterator iterator; 39 typedef std::set<SharedFD>::const_iterator const_iterator; 50 void Clr(const SharedFD& in) { in Clr() 54 bool IsSet(const SharedFD& in) const { in IsSet() 58 void Set(const SharedFD& in) { in Set() 67 std::set<SharedFD> value_;
|
/device/google/cuttlefish/host/commands/run_cvd/ |
D | boot_state_machine.cc | 49 Result<SharedFD> DaemonizeLauncher(const CuttlefishConfig& config) { in DaemonizeLauncher() 51 SharedFD read_end, write_end; in DaemonizeLauncher() 52 CF_EXPECT(SharedFD::Pipe(&read_end, &write_end), "Unable to create pipe"); in DaemonizeLauncher() 98 auto log = SharedFD::Open(log_path.c_str(), O_CREAT | O_WRONLY | O_APPEND, in DaemonizeLauncher() 106 auto dev_null = SharedFD::Open("/dev/null", O_RDONLY); in DaemonizeLauncher() 129 Result<SharedFD> ProcessLeader( in ProcessLeader() 134 CF_EXPECT(SharedFD::Fifo(instance.restore_adbd_pipe_name(), 0600), in ProcessLeader() 201 CF_EXPECT(SharedFD::Pipe(&interrupt_fd_read_, &interrupt_fd_write_)); in ResultSetup() 206 reboot_notification_ = SharedFD::Dup(FLAGS_reboot_notification_fd); in ResultSetup() 212 SharedFD boot_events_pipe = kernel_log_pipe_provider_.KernelLogPipe(); in ResultSetup() [all …]
|
/device/google/cuttlefish/host/commands/console_forwarder/ |
D | main.cpp | 54 ConsoleForwarder(std::string console_path, SharedFD console_in, in ConsoleForwarder() 55 SharedFD console_out, SharedFD console_log, in ConsoleForwarder() 56 SharedFD kernel_log) in ConsoleForwarder() 70 SharedFD OpenPTY() { in OpenPTY() 93 auto pty_shared_fd = SharedFD::Dup(pty); in OpenPTY() 101 void EnqueueWrite(std::shared_ptr<std::vector<char>> buf_ptr, SharedFD fd) { in EnqueueWrite() 111 SharedFD fd; in WriteLoop() 152 SharedFD client_fd; in ReadLoop() 201 SharedFD console_in_; 202 SharedFD console_out_; [all …]
|
/device/google/cuttlefish/common/libs/utils/ |
D | socket2socket_proxy.cpp | 40 : stop_fd_(SharedFD::Event()) { in ProxyPair() 69 void Start(SharedFD from, SharedFD to) { in Start() 87 void Forward(const std::string& label, SharedFD from, SharedFD to, in Forward() 88 SharedFD stop, std::atomic<bool>& running) { in Forward() 105 SharedFD stop_fd_; 114 ProxyServer::ProxyServer(SharedFD server, std::function<SharedFD()> clients_factory) in ProxyServer() 115 : stop_fd_(SharedFD::Event()) { in ProxyServer() 135 const int poll_result = SharedFD::Poll(server_poll, -1); in ProxyServer() 151 auto client = SharedFD::Accept(*server_fd); in ProxyServer() 190 void Proxy(SharedFD server, std::function<SharedFD()> conn_factory) { in Proxy() [all …]
|
D | socket2socket_proxy.h | 29 ProxyServer(SharedFD server, std::function<SharedFD()> clients_factory); 34 SharedFD stop_fd_; 46 void Proxy(SharedFD server, std::function<SharedFD()> conn_factory); 47 std::unique_ptr<ProxyServer> ProxyAsync(SharedFD server, std::function<SharedFD()> conn_factory);
|
D | subprocess.cpp | 61 const std::map<SharedFD, int>& inherited_fds) { in validate_redirects() argument 332 void Command::BuildParameter(std::stringstream* stream, SharedFD shared_fd) { in BuildParameter() 346 SharedFD shared_fd) & { in RedirectStdIO() 357 SharedFD shared_fd) && { in RedirectStdIO() 364 SharedFD::Dup(static_cast<int>(parent_channel))); in RedirectStdIO() 374 auto fd = SharedFD::Open(path, O_RDONLY | O_PATH | O_DIRECTORY); in SetWorkingDirectory() 376 auto fd = SharedFD::Open(path, O_RDONLY | O_DIRECTORY); in SetWorkingDirectory() 387 Command& Command::SetWorkingDirectory(SharedFD dirfd) & { in SetWorkingDirectory() 392 Command Command::SetWorkingDirectory(SharedFD dirfd) && { in SetWorkingDirectory() 478 if (SharedFD::Fchdir(working_directory_) != 0) { in Start() [all …]
|
/device/google/cuttlefish/host/commands/run_cvd/launch/ |
D | streamer.cpp | 42 SharedFD CreateUnixInputServer(const std::string& path) { in CreateUnixInputServer() 44 SharedFD::SocketLocalServer(path.c_str(), false, SOCK_STREAM, 0666); in CreateUnixInputServer() 60 SharedFD webrtc_socket, action_server_socket; in LaunchCustomActionServers() 61 if (!SharedFD::SocketPair(AF_LOCAL, SOCK_STREAM, 0, &webrtc_socket, in LaunchCustomActionServers() 141 SharedFD touch_socket = in ResultSetup() 159 SharedFD::SocketLocalServer(path, false, SOCK_SEQPACKET, 0666); in ResultSetup() 176 std::vector<SharedFD> fds; in InitializeVConsoles() 178 fds.emplace_back(CF_EXPECT(SharedFD::Fifo(path, 0660))); in InitializeVConsoles() 189 std::vector<SharedFD> touch_servers_; 190 SharedFD rotary_server_; [all …]
|
D | kernel_log_monitor.cpp | 73 SharedFD KernelLogPipe() override { in KernelLogPipe() 77 SharedFD ret = event_pipe_read_ends_.back(); in KernelLogPipe() 95 fifo_ = CF_EXPECT(SharedFD::Fifo(log_name, 0600)); in ResultSetup() 98 SharedFD event_pipe_write_end, event_pipe_read_end; in ResultSetup() 99 CF_EXPECT(SharedFD::Pipe(&event_pipe_read_end, &event_pipe_write_end), in ResultSetup() 109 SharedFD fifo_; 110 std::vector<SharedFD> event_pipe_write_ends_; 111 std::vector<SharedFD> event_pipe_read_ends_;
|
/device/google/cuttlefish/host/commands/modem_simulator/ |
D | channel_monitor.h | 59 Client(SharedFD fd); 60 Client(SharedFD read, SharedFD write); 61 Client(SharedFD fd, ClientType client_type); 62 Client(SharedFD read, SharedFD write, ClientType client_type); 82 SharedFD client_read_fd_; 83 SharedFD client_write_fd_; 92 ChannelMonitor(ModemSimulator& modem, cuttlefish::SharedFD server); 98 ClientId SetRemoteClient(SharedFD client, bool is_accepted); 108 cuttlefish::SharedFD server_; 109 cuttlefish::SharedFD read_pipe_; [all …]
|
D | channel_monitor.cpp | 43 Client::Client(SharedFD fd) : client_read_fd_(fd), client_write_fd_(fd) {} in Client() 45 Client::Client(SharedFD read, SharedFD write) in Client() 48 Client::Client(SharedFD fd, ClientType client_type) in Client() 51 Client::Client(SharedFD read, SharedFD write, ClientType client_type) in Client() 83 ChannelMonitor::ChannelMonitor(ModemSimulator& modem, SharedFD server) in ChannelMonitor() 85 if (!SharedFD::Pipe(&read_pipe_, &write_pipe_)) { in ChannelMonitor() 94 ClientId ChannelMonitor::SetRemoteClient(SharedFD client, bool is_accepted) { in SetRemoteClient() 121 auto client_fd = SharedFD::Accept(*server_); in AcceptIncomingConnection()
|
/device/google/cuttlefish/host/libs/audio_connector/ |
D | server.h | 57 SharedFD client_socket, uint32_t num_streams, uint32_t num_jacks, 75 SharedFD control_socket, SharedFD event_socket, in AudioClientConnection() 76 SharedFD tx_socket, SharedFD rx_socket) in AudioClientConnection() 89 ssize_t ReceiveMsg(SharedFD socket, void* buffer, size_t size); 93 SharedFD control_socket_; 94 SharedFD event_socket_; 95 SharedFD tx_socket_; 96 SharedFD rx_socket_; 101 AudioServer(SharedFD server_socket) : server_socket_(server_socket) {} in AudioServer() 110 SharedFD server_socket_;
|
D | server.cpp | 34 ScopedMMap AllocateShm(size_t size, const std::string& name, SharedFD* shm_fd) { in AllocateShm() 35 *shm_fd = SharedFD::MemfdCreate(name, 0); in AllocateShm() 65 bool CreateSocketPair(SharedFD* local, SharedFD* remote) { in CreateSocketPair() 66 auto ret = SharedFD::SocketPair(AF_UNIX, SOCK_SEQPACKET, 0, local, remote); in CreateSocketPair() 75 uint32_t buffer_offset, SharedFD socket) { in SendStatusCallback() 106 auto conn_fd = SharedFD::Accept(*server_socket_, nullptr, 0); in AcceptClient() 117 SharedFD client_socket, uint32_t num_streams, uint32_t num_jacks, in Create() 119 SharedFD event_socket, event_pair; in Create() 120 SharedFD tx_socket, tx_pair; in Create() 121 SharedFD rx_socket, rx_pair; in Create() [all …]
|
/device/google/cuttlefish/host/libs/command_util/ |
D | util.cc | 48 static Result<void> WriteAllBinaryResult(const SharedFD& fd, const T* t) { in WriteAllBinaryResult() 56 static Result<void> ReadExactBinaryResult(const SharedFD& fd, T* t) { in ReadExactBinaryResult() 65 Result<RunnerExitCodes> ReadExitCode(SharedFD monitor_socket) { in ReadExitCode() 72 Result<SharedFD> GetLauncherMonitorFromInstance( in GetLauncherMonitorFromInstance() 78 SharedFD monitor_socket = SharedFD::SocketLocalClient( in GetLauncherMonitorFromInstance() 86 Result<SharedFD> GetLauncherMonitor(const CuttlefishConfig& config, in GetLauncherMonitor() 93 Result<LauncherActionInfo> ReadLauncherActionFromFd(SharedFD monitor_socket) { in ReadLauncherActionFromFd() 128 Result<void> WaitForRead(SharedFD monitor_socket, const int timeout_seconds) { in WaitForRead() 143 Result<void> RunLauncherAction(SharedFD monitor_socket, LauncherAction action, in RunLauncherAction() 162 SharedFD monitor_socket, in RunLauncherAction()
|
D | util.h | 27 Result<RunnerExitCodes> ReadExitCode(SharedFD monitor_socket); 29 Result<SharedFD> GetLauncherMonitorFromInstance( 33 Result<SharedFD> GetLauncherMonitor(const CuttlefishConfig& config, 41 Result<LauncherActionInfo> ReadLauncherActionFromFd(SharedFD monitor_socket); 43 Result<void> WaitForRead(SharedFD monitor_socket, const int timeout_seconds); 47 Result<void> RunLauncherAction(SharedFD monitor_socket, LauncherAction action, 53 SharedFD monitor_socket,
|
/device/google/cuttlefish/common/libs/confui/ |
D | protocol.h | 42 std::unique_ptr<ConfUiMessage> RecvConfUiMsg(SharedFD fd); 44 SharedFD fd); 46 bool SendAbortCmd(SharedFD fd, const std::string& session_id); 48 bool SendAck(SharedFD fd, const std::string& session_id, const bool is_success, 50 bool SendResponse(SharedFD fd, const std::string& session_id, 57 bool SendStartCmd(SharedFD fd, const std::string& session_id, 63 bool SendStopCmd(SharedFD fd, const std::string& session_id); 66 bool SendUserSelection(SharedFD fd, const std::string& session_id,
|
/device/google/cuttlefish/common/frontend/socket_vsock_proxy/ |
D | server.cpp | 45 Result<SharedFD> TcpServer::Start() { in Start() 46 SharedFD server; in Start() 50 server = SharedFD::SocketLocalServer(port_, SOCK_STREAM); in Start() 74 Result<SharedFD> VsockServer::Start() { in Start() 75 SharedFD server; in Start() 77 server = SharedFD::VsockServer(port_, SOCK_STREAM, vhost_user_vsock_cid_); in Start() 94 DupServer::DupServer(int fd) : fd_(fd), sfd_(SharedFD::Dup(fd_)) { in DupServer() 98 Result<SharedFD> DupServer::Start() { in Start()
|
D | client.cpp | 29 SharedFD StartIpv4(const std::string& host, int port, std::chrono::seconds timeout) { in StartIpv4() 30 return SharedFD::SocketClient(host, port, SOCK_STREAM, timeout); in StartIpv4() 33 SharedFD StartIpv6(const std::string& host, int port, std::chrono::seconds timeout) { in StartIpv6() 49 return SharedFD::Socket6Client(host_name, interface_name, port, SOCK_STREAM, timeout); in StartIpv6() 59 SharedFD TcpClient::Start() { in Start() 60 SharedFD client; in Start() 90 SharedFD VsockClient::Start() { in Start() 92 SharedFD::VsockClient(id_, port_, SOCK_STREAM, vhost_user_vsock_); in Start()
|
/device/google/cuttlefish/host/commands/gnss_grpc_proxy/ |
D | gnss_grpc_proxy.cpp | 107 GnssGrpcProxyServiceImpl(cuttlefish::SharedFD gnss_in, in GnssGrpcProxyServiceImpl() 108 cuttlefish::SharedFD gnss_out, in GnssGrpcProxyServiceImpl() 109 cuttlefish::SharedFD fixed_location_in, in GnssGrpcProxyServiceImpl() 110 cuttlefish::SharedFD fixed_location_out) in GnssGrpcProxyServiceImpl() 305 void SendCommand(std::string command, cuttlefish::SharedFD source_out, in SendCommand() 383 cuttlefish::SharedFD gnss_in_; 384 cuttlefish::SharedFD gnss_out_; 385 cuttlefish::SharedFD fixed_location_in_; 386 cuttlefish::SharedFD fixed_location_out_; 409 auto gnss_in = cuttlefish::SharedFD::Dup(FLAGS_gnss_in_fd); in RunServer() [all …]
|
/device/google/cuttlefish/host/commands/secure_env/ |
D | suspend_resume_handler.h | 58 SharedFD rust; 59 SharedFD keymaster; 60 SharedFD gatekeeper; 61 SharedFD oemlock; 65 SnapshotCommandHandler(SharedFD channel_to_run_cvd, 72 SharedFD channel_to_run_cvd_;
|
/device/google/cuttlefish/host/frontend/webrtc/ |
D | main.cpp | 101 cuttlefish::SharedFD audio_server_fd = in CreateAudioServer() 102 cuttlefish::SharedFD::Dup(FLAGS_audio_server_fd); in CreateAudioServer() 117 auto control_socket = cuttlefish::SharedFD::Dup(FLAGS_command_fd); in main() 141 auto touch_shared_fd = cuttlefish::SharedFD::Dup(touch_fd); in main() 150 inputs_builder.WithRotary(cuttlefish::SharedFD::Dup(FLAGS_rotary_fd)); in main() 154 inputs_builder.WithKeyboard(cuttlefish::SharedFD::Dup(FLAGS_keyboard_fd)); in main() 158 inputs_builder.WithSwitches(cuttlefish::SharedFD::Dup(FLAGS_switches_fd)); in main() 165 cuttlefish::SharedFD::Dup(FLAGS_kernel_log_events_fd); in main() 314 cuttlefish::SharedFD custom_action_server = cuttlefish::SharedFD::Dup(fd); in main()
|