6 #include <g3log/g3log.hpp> 7 #include <readerwriterqueue.h> 12 #include <shared_mutex> 14 #define CONTEXT "CPSwarm" 48 std::map<std::string, ZyreNode>
_nodes;
60 std::thread *_worker =
nullptr;
72 bool security_enabled =
false;
79 unsigned char my_publickey[crypto_box_PUBLICKEYBYTES];
80 unsigned char my_secretkey[crypto_box_SECRETKEYBYTES];
81 unsigned char bcast_publickey[crypto_box_PUBLICKEYBYTES];
82 unsigned char bcast_secretkey[crypto_box_SECRETKEYBYTES];
83 unsigned char signature[crypto_sign_SECRETKEYBYTES];
84 unsigned char server_public[crypto_sign_PUBLICKEYBYTES];
85 unsigned char certificate[crypto_box_PUBLICKEYBYTES + crypto_sign_SECRETKEYBYTES];
87 bool isJoining =
false;
88 std::string configFilePath =
"config.cfg";
99 void Deliver(moodycamel::BlockingReaderWriterQueue<zyre_event_t *> *queue);
111 virtual void Send(
const void *data,
size_t size,
const Node *node)
override;
120 ZyreEndpoint(
const char *name,
const char *deviceClass);
129 void SetPort(uint16_t port);
138 void SetInterface(
const char *ifname);
145 void SetConfig(std::string cfg);
152 virtual void Start()
override;
159 virtual void Stop()
override;
182 std::list<const ZyreNode *> GetNodes();
190 virtual const Node *NodeForUUID(
const std::string &uuid)
override;
virtual const std::string & GetUUID() override
Get the UUID of the local node.
ZyreControlSocket _control
Control pipe to shut down event processing.
std::map< std::string, ZyreNode > _nodes
Node registry.
std::shared_timed_mutex _mutex
Mutex protecting the Nodes registry.
zyre_t * _zyre
Reference to the Zyre structure.
An Endpoint implementation using the Zyre protocol.
std::string _uuid
Local UUID.
An inproc socket bound to a special name generated from an object pointer.
An helper class for Endpoint implementations which implements some common basic functionality.
Represents a Node the Endpoint knows about and can send messages to.