diff options
author | Adam Ierymenko <adam.ierymenko@gmail.com> | 2015-04-15 18:47:38 -0700 |
---|---|---|
committer | Adam Ierymenko <adam.ierymenko@gmail.com> | 2015-04-15 18:47:38 -0700 |
commit | 91ca2381639bce22a02bdacf70f2ca30bdac9995 (patch) | |
tree | 6d116b7923d2d51ae13b1aab23b3a08439a0f021 | |
parent | 33c8d3c50b1645cad8f36c4f9116fa6fb00ff329 (diff) | |
download | infinitytier-91ca2381639bce22a02bdacf70f2ca30bdac9995.tar.gz infinitytier-91ca2381639bce22a02bdacf70f2ca30bdac9995.zip |
Compile fixes.
-rw-r--r-- | controller/SqliteNetworkController.cpp | 11 | ||||
-rw-r--r-- | one.cpp | 4 |
2 files changed, 8 insertions, 7 deletions
diff --git a/controller/SqliteNetworkController.cpp b/controller/SqliteNetworkController.cpp index 4dfdf78e..f18ca8d0 100644 --- a/controller/SqliteNetworkController.cpp +++ b/controller/SqliteNetworkController.cpp @@ -41,9 +41,10 @@ #include "../node/Utils.hpp" #include "../node/CertificateOfMembership.hpp" #include "../node/NetworkConfig.hpp" +#include "../osdep/OSUtils.hpp" // Include ZT_NETCONF_SCHEMA_SQL constant to init database -#include "netconf-schema.sql.c" +#include "schema.sql.c" // Stored in database as schemaVersion key in Config. // If not present, database is assumed to be empty and at the current schema version @@ -181,7 +182,7 @@ NetworkController::ResultCode SqliteNetworkController::doNetworkConfigRequest(co Identity alreadyKnownIdentity((const char *)sqlite3_column_text(_sGetNodeIdentity,0)); if (alreadyKnownIdentity == identity) { char lastSeen[64]; - Utils::snprintf(lastSeen,sizeof(lastSeen),"%llu",(unsigned long long)Utils::now()); + Utils::snprintf(lastSeen,sizeof(lastSeen),"%llu",(unsigned long long)OSUtils::now()); if (fromAddr) { std::string lastAt(fromAddr.toString()); sqlite3_reset(_sUpdateNode); @@ -207,7 +208,7 @@ NetworkController::ResultCode SqliteNetworkController::doNetworkConfigRequest(co if (fromAddr) lastAt = fromAddr.toString(); char lastSeen[64]; - Utils::snprintf(lastSeen,sizeof(lastSeen),"%llu",(unsigned long long)Utils::now()); + Utils::snprintf(lastSeen,sizeof(lastSeen),"%llu",(unsigned long long)OSUtils::now()); sqlite3_reset(_sCreateNode); sqlite3_bind_text(_sCreateNode,1,member.nodeId,10,SQLITE_STATIC); sqlite3_bind_text(_sCreateNode,2,idstr.c_str(),-1,SQLITE_STATIC); @@ -304,7 +305,7 @@ NetworkController::ResultCode SqliteNetworkController::doNetworkConfigRequest(co // Create and sign a new netconf, and save in database to re-use in the future char tss[24],rs[24]; - Utils::snprintf(tss,sizeof(tss),"%.16llx",(unsigned long long)Utils::now()); + Utils::snprintf(tss,sizeof(tss),"%.16llx",(unsigned long long)OSUtils::now()); Utils::snprintf(rs,sizeof(rs),"%.16llx",(unsigned long long)network.revision); netconf[ZT_NETWORKCONFIG_DICT_KEY_TIMESTAMP] = tss; netconf[ZT_NETWORKCONFIG_DICT_KEY_REVISION] = rs; @@ -458,7 +459,7 @@ NetworkController::ResultCode SqliteNetworkController::doNetworkConfigRequest(co } } - if (!netconf.sign(signingId)) { + if (!netconf.sign(signingId,OSUtils::now())) { netconf["error"] = "unable to sign netconf dictionary"; return NETCONF_QUERY_INTERNAL_SERVER_ERROR; } @@ -715,10 +715,10 @@ int main(int argc,char **argv) try { controller = new SqliteNetworkController((homeDir + ZT_PATH_SEPARATOR_S + ZT1_CONTROLLER_DB_PATH).c_str()); } catch (std::exception &exc) { - fprintf(stderr,"%s: failure initializing SqliteNetworkController: %s"ZT_EOL_S,exc.what()); + fprintf(stderr,"%s: failure initializing SqliteNetworkController: %s"ZT_EOL_S,argv[0],exc.what()); return 1; } catch ( ... ) { - fprintf(stderr,"%s: failure initializing SqliteNetworkController: unknown exception"ZT_EOL_S); + fprintf(stderr,"%s: failure initializing SqliteNetworkController: unknown exception"ZT_EOL_S,argv[0]); return 1; } #endif // ZT_ENABLE_NETWORK_CONTROLLER |