blob: 31fb88c36dc217e2b4fed421f458dc8bbce3a3d0 [file] [log] [blame]
// Copyright 2019 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 SRC_LIB_STORAGE_VFS_CPP_NODE_CONNECTION_H_
#define SRC_LIB_STORAGE_VFS_CPP_NODE_CONNECTION_H_
#ifndef __Fuchsia__
#error "Fuchsia-only header"
#endif
#include <fidl/fuchsia.io/cpp/wire.h>
#include "src/lib/storage/vfs/cpp/connection.h"
#include "src/lib/storage/vfs/cpp/vfs.h"
#include "src/lib/storage/vfs/cpp/vfs_types.h"
#include "src/lib/storage/vfs/cpp/vnode.h"
namespace fs {
namespace internal {
class NodeConnection final : public Connection, public fidl::WireServer<fuchsia_io::Node> {
public:
// Refer to documentation for |Connection::Connection|.
NodeConnection(fs::FuchsiaVfs* vfs, fbl::RefPtr<fs::Vnode> vnode, VnodeProtocol protocol,
VnodeConnectionOptions options);
~NodeConnection() final = default;
private:
//
// |fuchsia.io/Node| operations.
//
void Clone(CloneRequestView request, CloneCompleter::Sync& completer) final;
void Close(CloseCompleter::Sync& completer) final;
void Query(QueryCompleter::Sync& completer) final;
void DescribeDeprecated(DescribeDeprecatedCompleter::Sync& completer) final;
void GetConnectionInfo(GetConnectionInfoCompleter::Sync& completer) final;
void Sync(SyncCompleter::Sync& completer) final;
void GetAttr(GetAttrCompleter::Sync& completer) final;
void SetAttr(SetAttrRequestView request, SetAttrCompleter::Sync& completer) final;
void GetFlags(GetFlagsCompleter::Sync& completer) final;
void SetFlags(SetFlagsRequestView request, SetFlagsCompleter::Sync& completer) final;
void QueryFilesystem(QueryFilesystemCompleter::Sync& completer) final;
};
} // namespace internal
} // namespace fs
#endif // SRC_LIB_STORAGE_VFS_CPP_NODE_CONNECTION_H_