34 lines
722 B
C++
34 lines
722 B
C++
#ifndef RETRONFS95_NFS_HPP
|
|
#define RETRONFS95_NFS_HPP
|
|
|
|
#include "mount.hpp"
|
|
|
|
namespace retronfs {
|
|
|
|
struct DirEntry {
|
|
uint64_t fileid;
|
|
std::string name;
|
|
uint64_t cookie;
|
|
};
|
|
|
|
class NfsClient {
|
|
public:
|
|
NfsClient(const std::string& host, unsigned short port, const RpcIdentity& identity);
|
|
|
|
FileHandle lookup(const FileHandle& dir, const std::string& name);
|
|
std::vector<DirEntry> readdir(const FileHandle& dir);
|
|
Bytes read(const FileHandle& file, uint64_t offset, uint32_t count, bool* eof);
|
|
Bytes read_all(const FileHandle& file);
|
|
|
|
private:
|
|
RpcClient rpc_;
|
|
RpcIdentity identity_;
|
|
};
|
|
|
|
FileHandle resolve_path(NfsClient& nfs, const FileHandle& root, const std::string& path);
|
|
|
|
}
|
|
|
|
#endif
|
|
|