| // Copyright 2018 The Fuchsia Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| |
| #ifndef GARNET_BIN_NETEMUL_RUNNER_VIRTUAL_DEVICES_H_ |
| #define GARNET_BIN_NETEMUL_RUNNER_VIRTUAL_DEVICES_H_ |
| |
| #include <fbl/ref_ptr.h> |
| #include <fs/pseudo-dir.h> |
| #include <fs/synchronous-vfs.h> |
| #include <fs/vnode.h> |
| #include <fuchsia/netemul/network/cpp/fidl.h> |
| #include <lib/fidl/cpp/interface_ptr.h> |
| #include <string> |
| |
| namespace netemul { |
| |
| class VirtualDevices { |
| public: |
| using DevProxy = fuchsia::netemul::network::DeviceProxy; |
| VirtualDevices(); |
| |
| void AddEntry(const std::string& path, fidl::InterfacePtr<DevProxy> dev); |
| |
| zx::channel OpenAsDirectory(); |
| |
| private: |
| fs::SynchronousVfs vdev_vfs_; |
| fbl::RefPtr<fs::PseudoDir> dir_; |
| }; |
| |
| } // namespace netemul |
| |
| #endif // GARNET_BIN_NETEMUL_RUNNER_VIRTUAL_DEVICES_H_ |