diff options
author | Grant Limberg <glimberg@gmail.com> | 2015-05-16 14:35:35 -0700 |
---|---|---|
committer | Grant Limberg <glimberg@gmail.com> | 2015-05-16 14:35:35 -0700 |
commit | d0935f667fd809a32cb4184a2c422ff79dc6d933 (patch) | |
tree | 8dd92dfbe2fdd30375993a21619f701d48060340 /service/ControlPlane.cpp | |
parent | 4a0280686c7a74b58a060375ffce385554d90040 (diff) | |
parent | 38243e5eff71b76d35904afffd2b21fe84ed958a (diff) | |
download | infinitytier-d0935f667fd809a32cb4184a2c422ff79dc6d933.tar.gz infinitytier-d0935f667fd809a32cb4184a2c422ff79dc6d933.zip |
Merge branch 'adamierymenko-dev' into android-jni
Diffstat (limited to 'service/ControlPlane.cpp')
-rw-r--r-- | service/ControlPlane.cpp | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/service/ControlPlane.cpp b/service/ControlPlane.cpp index c92087f7..69c5d48d 100644 --- a/service/ControlPlane.cpp +++ b/service/ControlPlane.cpp @@ -360,7 +360,8 @@ unsigned int ControlPlane::handleRequest( "\t\"versionMajor\":%d,\n" "\t\"versionMinor\":%d,\n" "\t\"versionRev\":%d,\n" - "\t\"version\":\"%d.%d.%d\"\n" + "\t\"version\":\"%d.%d.%d\",\n" + "\t\"clock\": %llu\n" "}\n", status.address, status.publicIdentity, @@ -368,7 +369,8 @@ unsigned int ControlPlane::handleRequest( ZEROTIER_ONE_VERSION_MAJOR, ZEROTIER_ONE_VERSION_MINOR, ZEROTIER_ONE_VERSION_REVISION, - ZEROTIER_ONE_VERSION_MAJOR,ZEROTIER_ONE_VERSION_MINOR,ZEROTIER_ONE_VERSION_REVISION); + ZEROTIER_ONE_VERSION_MAJOR,ZEROTIER_ONE_VERSION_MINOR,ZEROTIER_ONE_VERSION_REVISION, + (unsigned long long)OSUtils::now()); responseBody = json; scode = 200; } else if (ps[0] == "config") { @@ -433,6 +435,14 @@ unsigned int ControlPlane::handleRequest( } // else 404 _node->freeQueryResult((void *)pl); } else scode = 500; + } else if (ps[0] == "newIdentity") { + // Return a newly generated ZeroTier identity -- this is primarily for debugging + // and testing to make it easy for automated test scripts to generate test IDs. + Identity newid; + newid.generate(); + responseBody = newid.toString(true); + responseContentType = "text/plain"; + scode = 200; } else { std::map<std::string,ControlPlaneSubsystem *>::const_iterator ss(_subsystems.find(ps[0])); if (ss != _subsystems.end()) |