diff --git a/include/neocomm.h b/include/neocomm.h index 3564cce..f205ac7 100644 --- a/include/neocomm.h +++ b/include/neocomm.h @@ -105,6 +105,13 @@ int NeoComm_import_nodes(const char *node_file); */ int NeoComm_export_nodes(const char *node_file); +/** + * @brief Retrieve statistics about the local node. + * + * @return A text description of the local node's status. + */ +const char *NeoComm_get_node_stats(); + /** * @brief Join a channel. * diff --git a/src/node.cpp b/src/node.cpp index 7ae15e6..c5de95d 100644 --- a/src/node.cpp +++ b/src/node.cpp @@ -112,3 +112,7 @@ int NeoComm_export_nodes(const char *node_file) { msgpack::pack(export_file, node.exportNodes()); return 1; } + +const char *NeoComm_get_node_stats() { + return node.getNodesStats(AF_UNSPEC).toString().c_str(); +}