From dcbc9c8ddd7cdb543e213e3402050724174df03a Mon Sep 17 00:00:00 2001 From: Adam Ierymenko Date: Mon, 7 Oct 2013 15:21:40 -0400 Subject: Rename error code for no membership certificate. --- node/Network.hpp | 18 +++--------------- node/Packet.cpp | 2 +- node/Packet.hpp | 2 +- node/PacketDecoder.cpp | 6 +++--- 4 files changed, 8 insertions(+), 20 deletions(-) (limited to 'node') diff --git a/node/Network.hpp b/node/Network.hpp index 70be56fc..81af694b 100644 --- a/node/Network.hpp +++ b/node/Network.hpp @@ -135,11 +135,7 @@ public: COM_RESERVED_ID_NETWORK_ID = 1 // network ID, max delta always 0 }; - CertificateOfMembership() - { - memset(_signature.data,0,_signature.size()); - } - + CertificateOfMembership() { memset(_signature.data,0,_signature.size()); } CertificateOfMembership(const char *s) { fromString(s); } CertificateOfMembership(const std::string &s) { fromString(s.c_str()); } @@ -205,20 +201,12 @@ public: /** * @return True if signed */ - inline bool isSigned() const - throw() - { - return (_signedBy); - } + inline bool isSigned() const throw() { return (_signedBy); } /** * @return Address that signed this certificate or null address if none */ - inline const Address &signedBy() const - throw() - { - return _signedBy; - } + inline const Address &signedBy() const throw() { return _signedBy; } private: struct _Qualifier diff --git a/node/Packet.cpp b/node/Packet.cpp index c35c8f7e..d2226f36 100644 --- a/node/Packet.cpp +++ b/node/Packet.cpp @@ -62,7 +62,7 @@ const char *Packet::errorString(ErrorCode e) case ERROR_OBJ_NOT_FOUND: return "OBJECT_NOT_FOUND"; case ERROR_IDENTITY_COLLISION: return "IDENTITY_COLLISION"; case ERROR_UNSUPPORTED_OPERATION: return "UNSUPPORTED_OPERATION"; - case ERROR_NO_MEMBER_CERTIFICATE: return "NO_MEMBER_CERTIFICATE"; + case ERROR_NEED_MEMBERSHIP_CERTIFICATE: return "NEED_MEMBERSHIP_CERTIFICATE"; } return "(unknown)"; } diff --git a/node/Packet.hpp b/node/Packet.hpp index 57d5a750..36858479 100644 --- a/node/Packet.hpp +++ b/node/Packet.hpp @@ -626,7 +626,7 @@ public: ERROR_UNSUPPORTED_OPERATION = 5, /* Message to private network rejected -- no unexpired certificate on file */ - ERROR_NO_MEMBER_CERTIFICATE = 6 + ERROR_NEED_MEMBERSHIP_CERTIFICATE = 6 }; /** diff --git a/node/PacketDecoder.cpp b/node/PacketDecoder.cpp index 9ae7270d..56b8cc39 100644 --- a/node/PacketDecoder.cpp +++ b/node/PacketDecoder.cpp @@ -140,7 +140,7 @@ bool PacketDecoder::_doERROR(const RuntimeEnvironment *_r,const SharedPtr case Packet::ERROR_IDENTITY_COLLISION: // TODO: if it comes from a supernode, regenerate a new identity break; - case Packet::ERROR_NO_MEMBER_CERTIFICATE: + case Packet::ERROR_NEED_MEMBERSHIP_CERTIFICATE: // TODO: send member certificate break; default: @@ -358,7 +358,7 @@ bool PacketDecoder::_doFRAME(const RuntimeEnvironment *_r,const SharedPtr Packet outp(source(),_r->identity.address(),Packet::VERB_ERROR); outp.append((unsigned char)Packet::VERB_FRAME); outp.append(packetId()); - outp.append((unsigned char)Packet::ERROR_NO_MEMBER_CERTIFICATE); + outp.append((unsigned char)Packet::ERROR_NEED_MEMBERSHIP_CERTIFICATE); outp.append(network->id()); outp.armor(peer->key(),true); _r->demarc->send(_localPort,_remoteAddress,outp.data(),outp.size(),-1); @@ -466,7 +466,7 @@ bool PacketDecoder::_doMULTICAST_FRAME(const RuntimeEnvironment *_r,const Shared Packet outp(source(),_r->identity.address(),Packet::VERB_ERROR); outp.append((unsigned char)Packet::VERB_FRAME); outp.append(packetId()); - outp.append((unsigned char)Packet::ERROR_NO_MEMBER_CERTIFICATE); + outp.append((unsigned char)Packet::ERROR_NEED_MEMBERSHIP_CERTIFICATE); outp.append(nwid); outp.armor(peer->key(),true); _r->demarc->send(_localPort,_remoteAddress,outp.data(),outp.size(),-1); -- cgit v1.2.3