Public Member Functions | Private Member Functions | Private Attributes | List of all members
swarmio::transport::zyre::ZyreNode Class Referencefinal

A Node as discovered by the Zyre protocol. More...

#include <ZyreNode.h>

Inheritance diagram for swarmio::transport::zyre::ZyreNode:
Inheritance graph
[legend]

Public Member Functions

const std::string & GetAddress () const
 Get the IP address of the node. More...
 
const unsigned char * GetCtr () const
 Get the nonce counter of the node. More...
 
virtual std::string GetDescription () const override
 Get a user-readable description of the node. More...
 
const unsigned char * GetKey () const
 Get the shared cryptographic key of the node. More...
 
const unsigned char * GetPubKey () const
 Get the public key of the node. More...
 
const bool GetVerified () const
 Is the node verified? More...
 
void IncrementCtr () const
 Increment the nonce counter the node. More...
 
bool IsOnline () const override
 Is the Node currently online? More...
 
void SetCtr (unsigned char *c) const
 Set the nonce (counter) More...
 
void SetKeys (unsigned char *k, unsigned char *pk)
 Set the shared cryptographic key and the public key of the node. More...
 
void SetVerified ()
 Set the verified status of the node. More...
 
 ZyreNode (const std::string &uuid, const std::string &name, const std::string &deviceClass, const std::string &address)
 Construct a new ZyreNode object. More...
 
- Public Member Functions inherited from swarmio::transport::BasicNode
 BasicNode (const std::string &uuid, const std::string &name, const std::string &deviceClass)
 Construct a new BasicNode object. More...
 
virtual const std::string & GetDeviceClass () const override
 Get the class of the underlying device. More...
 
virtual const std::string & GetName () const override
 Returns the (possibly non-unique) name of the node. More...
 
virtual const std::string & GetUUID () const override
 Get the unique identifier of the node. More...
 
- Public Member Functions inherited from swarmio::Node
virtual ~Node ()
 Destroy the Node object. More...
 

Private Member Functions

void SetOnline (bool online)
 Mark the Node as online or offline. More...
 

Private Attributes

std::string _address
 IP address of the node. More...
 
unsigned char _key [32]
 Shared key. More...
 
unsigned char _message_counter [24]
 Message counter as nonce and replay attack. More...
 
std::atomic< bool > _online
 Is the Node currently online? More...
 
unsigned char _pubkey [32]
 Public key. More...
 
std::atomic< bool > _verified
 Is the Node verified? More...
 
friend ZyreEndpoint
 Only ZyreEdpoint can manage these objects. More...
 

Detailed Description

A Node as discovered by the Zyre protocol.

Definition at line 20 of file ZyreNode.h.

Constructor & Destructor Documentation

swarmio::transport::zyre::ZyreNode::ZyreNode ( const std::string &  uuid,
const std::string &  name,
const std::string &  deviceClass,
const std::string &  address 
)
inline

Construct a new ZyreNode object.

Parameters
uuidUUID
nameDiscoverable name
deviceClassDevice class
addressIP address

Definition at line 86 of file ZyreNode.h.

Member Function Documentation

const std::string& swarmio::transport::zyre::ZyreNode::GetAddress ( ) const
inline

Get the IP address of the node.

Returns
const std::string&

Definition at line 104 of file ZyreNode.h.

const unsigned char* swarmio::transport::zyre::ZyreNode::GetCtr ( ) const
inline

Get the nonce counter of the node.

Returns
unsigned char&

Definition at line 144 of file ZyreNode.h.

virtual std::string swarmio::transport::zyre::ZyreNode::GetDescription ( ) const
inlineoverridevirtual

Get a user-readable description of the node.

Returns
std::string

Implements swarmio::Node.

Definition at line 191 of file ZyreNode.h.

const unsigned char* swarmio::transport::zyre::ZyreNode::GetKey ( ) const
inline

Get the shared cryptographic key of the node.

Returns
const unsigned char&

Definition at line 114 of file ZyreNode.h.

const unsigned char* swarmio::transport::zyre::ZyreNode::GetPubKey ( ) const
inline

Get the public key of the node.

Returns
const unsigned char&

Definition at line 124 of file ZyreNode.h.

const bool swarmio::transport::zyre::ZyreNode::GetVerified ( ) const
inline

Is the node verified?

Returns
unsigned char&

Definition at line 154 of file ZyreNode.h.

void swarmio::transport::zyre::ZyreNode::IncrementCtr ( ) const
inline

Increment the nonce counter the node.

Definition at line 172 of file ZyreNode.h.

bool swarmio::transport::zyre::ZyreNode::IsOnline ( ) const
inlineoverridevirtual

Is the Node currently online?

Returns
True if online

Implements swarmio::Node.

Definition at line 94 of file ZyreNode.h.

void swarmio::transport::zyre::ZyreNode::SetCtr ( unsigned char *  c) const
inline

Set the nonce (counter)

Definition at line 181 of file ZyreNode.h.

void swarmio::transport::zyre::ZyreNode::SetKeys ( unsigned char *  k,
unsigned char *  pk 
)
inline

Set the shared cryptographic key and the public key of the node.

Definition at line 133 of file ZyreNode.h.

void swarmio::transport::zyre::ZyreNode::SetOnline ( bool  online)
inlineprivate

Mark the Node as online or offline.

Parameters
onlineCurrent status

Definition at line 71 of file ZyreNode.h.

void swarmio::transport::zyre::ZyreNode::SetVerified ( )
inline

Set the verified status of the node.

Definition at line 163 of file ZyreNode.h.

Member Data Documentation

std::string swarmio::transport::zyre::ZyreNode::_address
private

IP address of the node.

Definition at line 52 of file ZyreNode.h.

unsigned char swarmio::transport::zyre::ZyreNode::_key[32]
private

Shared key.

Definition at line 40 of file ZyreNode.h.

unsigned char swarmio::transport::zyre::ZyreNode::_message_counter[24]
private

Message counter as nonce and replay attack.

Definition at line 34 of file ZyreNode.h.

std::atomic<bool> swarmio::transport::zyre::ZyreNode::_online
private

Is the Node currently online?

Definition at line 58 of file ZyreNode.h.

unsigned char swarmio::transport::zyre::ZyreNode::_pubkey[32]
private

Public key.

Definition at line 46 of file ZyreNode.h.

std::atomic<bool> swarmio::transport::zyre::ZyreNode::_verified
private

Is the Node verified?

Definition at line 64 of file ZyreNode.h.

friend swarmio::transport::zyre::ZyreNode::ZyreEndpoint
private

Only ZyreEdpoint can manage these objects.

Definition at line 28 of file ZyreNode.h.


The documentation for this class was generated from the following file:


swarmros
Author(s):
autogenerated on Fri Apr 3 2020 03:42:48