diff options
Diffstat (limited to 'node/Topology.hpp')
-rw-r--r-- | node/Topology.hpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/node/Topology.hpp b/node/Topology.hpp index 78dc0fe8..dca35789 100644 --- a/node/Topology.hpp +++ b/node/Topology.hpp @@ -38,6 +38,7 @@ #include "InetAddress.hpp" #include "Hashtable.hpp" #include "World.hpp" +#include "CertificateOfRepresentation.hpp" namespace ZeroTier { @@ -383,6 +384,25 @@ public: _trustedPathCount = count; } + /** + * @return Current certificate of representation (copy) + */ + inline CertificateOfRepresentation certificateOfRepresentation() const + { + Mutex::Lock _l(_upstreams_m); + return _cor; + } + + /** + * @param buf Buffer to receive COR + */ + template<unsigned int C> + void appendCertificateOfRepresentation(Buffer<C> &buf) + { + Mutex::Lock _l(_upstreams_m); + _cor.serialize(buf); + } + private: Identity _getIdentity(const Address &zta); void _memoizeUpstreams(); @@ -404,6 +424,7 @@ private: std::vector<World> _moons; std::vector<Address> _contactingMoons; std::vector<Address> _upstreamAddresses; + CertificateOfRepresentation _cor; bool _amRoot; Mutex _upstreams_m; // locks worlds, upstream info, moon info, etc. }; |