Files

38 lines
1.0 KiB
C++
Raw Permalink Normal View History

/* (c) ZeroTier, Inc.
* See LICENSE.txt in nonfree/
*/
#ifndef ZT_CONTROLLER_FILEDB_HPP
#define ZT_CONTROLLER_FILEDB_HPP
#include "DB.hpp"
2025-07-03 11:26:23 -04:00
namespace ZeroTier {
2025-07-03 11:26:23 -04:00
class FileDB : public DB {
public:
FileDB(const char* path);
virtual ~FileDB();
virtual bool waitForReady();
virtual bool isReady();
2025-07-03 11:26:23 -04:00
virtual bool save(nlohmann::json& record, bool notifyListeners);
virtual void eraseNetwork(const uint64_t networkId);
2025-07-03 11:26:23 -04:00
virtual void eraseMember(const uint64_t networkId, const uint64_t memberId);
virtual void nodeIsOnline(const uint64_t networkId, const uint64_t memberId, const InetAddress& physicalAddress);
virtual void nodeIsOnline(const uint64_t networkId, const uint64_t memberId, const InetAddress& physicalAddress, const char* osArch);
protected:
2019-08-06 10:42:54 -05:00
std::string _path;
std::string _networksPath;
2018-01-10 15:03:39 -08:00
std::string _tracePath;
2019-07-15 15:27:53 -05:00
std::thread _onlineUpdateThread;
2025-07-03 11:26:23 -04:00
std::map<uint64_t, std::map<uint64_t, std::map<int64_t, InetAddress> > > _online;
2019-07-15 15:27:53 -05:00
std::mutex _online_l;
bool _running;
};
2025-07-03 11:26:23 -04:00
} // namespace ZeroTier
#endif