mirror of
https://github.com/ZeroTier/ZeroTierOne
synced 2025-08-20 13:24:09 -07:00
Integrate moon concept into http config bus, and clean up that code quite a bit.
This commit is contained in:
parent
c95bae2d73
commit
4b11566505
7 changed files with 265 additions and 360 deletions
|
@ -362,8 +362,6 @@ uint64_t Node::address() const
|
|||
void Node::status(ZT_NodeStatus *status) const
|
||||
{
|
||||
status->address = RR->identity.address().toInt();
|
||||
status->worldId = RR->topology->planetWorldId();
|
||||
status->worldTimestamp = RR->topology->planetWorldTimestamp();
|
||||
status->publicIdentity = RR->publicIdentityStr.c_str();
|
||||
status->secretIdentity = RR->secretIdentityStr.c_str();
|
||||
status->online = _online ? 1 : 0;
|
||||
|
@ -714,6 +712,16 @@ void Node::setTrustedPaths(const struct sockaddr_storage *networks,const uint64_
|
|||
RR->topology->setTrustedPaths(reinterpret_cast<const InetAddress *>(networks),ids,count);
|
||||
}
|
||||
|
||||
World Node::planet() const
|
||||
{
|
||||
return RR->topology->planet();
|
||||
}
|
||||
|
||||
std::vector<World> Node::moons() const
|
||||
{
|
||||
return RR->topology->moons();
|
||||
}
|
||||
|
||||
void Node::ncSendConfig(uint64_t nwid,uint64_t requestPacketId,const Address &destination,const NetworkConfig &nc,bool sendLegacyFormatConfig)
|
||||
{
|
||||
if (destination == RR->identity.address()) {
|
||||
|
|
|
@ -24,6 +24,7 @@
|
|||
#include <string.h>
|
||||
|
||||
#include <map>
|
||||
#include <vector>
|
||||
|
||||
#include "Constants.hpp"
|
||||
|
||||
|
@ -54,6 +55,8 @@
|
|||
|
||||
namespace ZeroTier {
|
||||
|
||||
class World;
|
||||
|
||||
/**
|
||||
* Implementation of Node object as defined in CAPI
|
||||
*
|
||||
|
@ -210,6 +213,9 @@ public:
|
|||
void postCircuitTestReport(const ZT_CircuitTestReport *report);
|
||||
void setTrustedPaths(const struct sockaddr_storage *networks,const uint64_t *ids,unsigned int count);
|
||||
|
||||
World planet() const;
|
||||
std::vector<World> moons() const;
|
||||
|
||||
/**
|
||||
* Register that we are expecting a reply to a packet ID
|
||||
*
|
||||
|
|
|
@ -135,6 +135,16 @@ public:
|
|||
*/
|
||||
inline uint64_t timestamp() const { return _ts; }
|
||||
|
||||
/**
|
||||
* @return C25519 signature
|
||||
*/
|
||||
inline const C25519::Signature &signature() const { return _signature; }
|
||||
|
||||
/**
|
||||
* @return Public key that must sign next update
|
||||
*/
|
||||
inline const C25519::Public &updatesMustBeSignedBy() const { return _updatesMustBeSignedBy; }
|
||||
|
||||
/**
|
||||
* Check whether a world update should replace this one
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue