diff options
| author | Adam Ierymenko <adam.ierymenko@gmail.com> | 2016-08-08 17:33:26 -0700 |
|---|---|---|
| committer | Adam Ierymenko <adam.ierymenko@gmail.com> | 2016-08-08 17:33:26 -0700 |
| commit | 00fd9c3a15f9ac0981cf79c98515df888b3bd109 (patch) | |
| tree | be2aeb7bbeb87b09cc43f4120c5fe39c0e467a06 /node/Network.hpp | |
| parent | 8007ca56aaa2781e068ce9e3849a64b1e7bf7b8f (diff) | |
| download | infinitytier-00fd9c3a15f9ac0981cf79c98515df888b3bd109.tar.gz infinitytier-00fd9c3a15f9ac0981cf79c98515df888b3bd109.zip | |
It builds... almost ready to test some rules engine stuff.
Diffstat (limited to 'node/Network.hpp')
| -rw-r--r-- | node/Network.hpp | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/node/Network.hpp b/node/Network.hpp index 06fd7735..16f07163 100644 --- a/node/Network.hpp +++ b/node/Network.hpp @@ -337,6 +337,42 @@ public: void learnBridgedMulticastGroup(const MulticastGroup &mg,uint64_t now); /** + * @param com Certificate of membership + * @return 0 == OK, 1 == waiting for WHOIS, -1 == BAD signature or credential + */ + inline int addCredential(const CertificateOfMembership &com) + { + if (com.networkId() != _id) + return -1; + Mutex::Lock _l(_lock); + return _memberships[com.issuedTo()].addCredential(RR,com); + } + + /** + * @param cap Capability + * @return 0 == OK, 1 == waiting for WHOIS, -1 == BAD signature or credential + */ + inline int addCredential(const Capability &cap) + { + if (cap.networkId() != _id) + return -1; + Mutex::Lock _l(_lock); + return _memberships[cap.issuedTo()].addCredential(RR,cap); + } + + /** + * @param cap Tag + * @return 0 == OK, 1 == waiting for WHOIS, -1 == BAD signature or credential + */ + inline int addCredential(const Tag &tag) + { + if (tag.networkId() != _id) + return -1; + Mutex::Lock _l(_lock); + return _memberships[tag.issuedTo()].addCredential(RR,tag); + } + + /** * Destroy this network * * This causes the network to disable itself, destroy its tap device, and on |
