#pragma once #include "cluster_client.h" #include "epoll_manager.h" #include "nfs_portmap.h" #include "nfsc/libnfs-raw.h" class nfs_proxy_t { public: std::string bind_address; std::string name_prefix; int fsid = 1; portmap_service_t pmap; ring_loop_t *ringloop = NULL; epoll_manager_t *epmgr = NULL; cluster_client_t *cli = NULL; uint64_t next_dir_id = 2; std::map dir_by_hash; std::map dir_ids; std::map dir_mod_rev; std::map hash_by_inode; std::map inode_by_hash; ~nfs_proxy_t(); static json11::Json::object parse_args(int narg, const char *args[]); void run(json11::Json cfg); void do_accept(int listen_fd); void daemonize(); }; class nfs_client_t { public: nfs_proxy_t *parent = NULL; int nfs_fd; struct rpc_context *rpc = NULL; std::vector nfs3_pt; std::vector nfs3_mount_pt; nfs_client_t(); ~nfs_client_t(); };