X-Git-Url: http://git.meshlink.io/?a=blobdiff_plain;f=src%2Fmeshlink%2B%2B.h;h=4f63a6d9d0507ed1c9e6b86307ea64b8d519d97a;hb=8ccad64979db3f96e935c6fbfaf9733dafe2ee66;hp=183544ac99f3c4ebf3819b243457f2044542c06e;hpb=c4deb6c20dceb73c0ac6baa2eb901434584e6191;p=meshlink diff --git a/src/meshlink++.h b/src/meshlink++.h index 183544ac..4f63a6d9 100644 --- a/src/meshlink++.h +++ b/src/meshlink++.h @@ -431,6 +431,17 @@ public: return meshlink_get_node_reachability(handle, node, last_reachable, last_unreachable); } + /// Get a node's blacklist status. + /** This function returns the current blacklist status of a given node. + * + * @param node A pointer to a meshlink::node describing the node. + * + * @return This function returns true if the node is currently blacklisted, false otherwise. + */ + bool get_node_blacklisted(node *node) { + return meshlink_get_node_blacklisted(handle, node); + } + /// Get a handle for a specific submesh. /** This function returns a handle for the submesh with the given name. * @@ -465,6 +476,22 @@ public: return (node **)meshlink_get_all_nodes(handle, (meshlink_node_t **)nodes, nmemb); } + /// Get a list of all nodes by blacklist status. + /** This function returns a list with handles for all the nodes who were either blacklisted or whitelisted. + * + * @param blacklisted If true, a list of blacklisted nodes will be returned, otherwise whitelisted nodes. + * @param nodes A pointer to an array of pointers to meshlink::node, which should be allocated by the application. + * @param nmemb The maximum number of pointers that can be stored in the nodes array. + * + * @return A pointer to an array containing pointers to all known nodes with the given blacklist status. + * If the @a nodes argument was not NULL, then the return value can either be the same value or a different value. + * If it is a new value, the old value of @a nodes should not be used anymore. + * If the new value is NULL, then the old array will have been freed by MeshLink. + */ + node **get_all_nodes_by_blacklisted(bool blacklisted, node **nodes, size_t *nmemb) { + return (node **)meshlink_get_all_nodes_by_blacklisted(handle, blacklisted, (meshlink_node_t **)nodes, nmemb); + } + /// Sign data using the local node's MeshLink key. /** This function signs data using the local node's MeshLink key. * The generated signature can be securely verified by other nodes. @@ -518,7 +545,6 @@ public: /// Clear the canonical Address for a node. /** This function clears the canonical Address for a node. * - * @param mesh A handle which represents an instance of MeshLink. * @param node A pointer to a struct meshlink_node describing the node. * * @return This function returns true if the address was removed, false otherwise.