Prep in controller code to run tests.
This commit is contained in:
parent
3593fb3462
commit
7394ec6f6a
3 changed files with 19 additions and 6 deletions
|
@ -44,12 +44,15 @@
|
|||
#include "../ext/json-parser/json.h"
|
||||
|
||||
#include "SqliteNetworkController.hpp"
|
||||
|
||||
#include "../node/Node.hpp"
|
||||
#include "../node/Utils.hpp"
|
||||
#include "../node/CertificateOfMembership.hpp"
|
||||
#include "../node/NetworkConfig.hpp"
|
||||
#include "../node/InetAddress.hpp"
|
||||
#include "../node/MAC.hpp"
|
||||
#include "../node/Address.hpp"
|
||||
|
||||
#include "../osdep/OSUtils.hpp"
|
||||
|
||||
// Include ZT_NETCONF_SCHEMA_SQL constant to init database
|
||||
|
@ -117,8 +120,10 @@ struct NetworkRecord {
|
|||
|
||||
} // anonymous namespace
|
||||
|
||||
SqliteNetworkController::SqliteNetworkController(const char *dbPath) :
|
||||
SqliteNetworkController::SqliteNetworkController(Node *node,const char *dbPath,const char *circuitTestPath) :
|
||||
_node(node),
|
||||
_dbPath(dbPath),
|
||||
_circuitTestPath(circuitTestPath),
|
||||
_db((sqlite3 *)0)
|
||||
{
|
||||
if (sqlite3_open_v2(dbPath,&_db,SQLITE_OPEN_READWRITE|SQLITE_OPEN_CREATE,(const char *)0) != SQLITE_OK)
|
||||
|
|
|
@ -45,10 +45,12 @@
|
|||
|
||||
namespace ZeroTier {
|
||||
|
||||
class Node;
|
||||
|
||||
class SqliteNetworkController : public NetworkController
|
||||
{
|
||||
public:
|
||||
SqliteNetworkController(const char *dbPath);
|
||||
SqliteNetworkController(Node *node,const char *dbPath,const char *circuitTestPath);
|
||||
virtual ~SqliteNetworkController();
|
||||
|
||||
virtual NetworkController::ResultCode doNetworkConfigRequest(
|
||||
|
@ -104,7 +106,9 @@ private:
|
|||
const Dictionary &metaData,
|
||||
Dictionary &netconf);
|
||||
|
||||
Node *_node;
|
||||
std::string _dbPath;
|
||||
std::string _circuitTestPath;
|
||||
std::string _instanceId;
|
||||
|
||||
// A circular buffer last log
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue