]> git.meshlink.io Git - meshlink/blobdiff - src/meshlink.h
Set meshlink_errno when trying to create a channel to a blacklisted node.
[meshlink] / src / meshlink.h
index 11395f043a02d6acd2e95cc39cdce68831ca30be..3d12af6b87b40e4679b426a2015ab1fc1567622f 100644 (file)
@@ -59,18 +59,19 @@ typedef struct meshlink_submesh meshlink_submesh_t;
 
 /// Code of most recent error encountered.
 typedef enum {
-       MESHLINK_OK,        ///< Everything is fine
-       MESHLINK_EINVAL,    ///< Invalid parameter(s) to function call
-       MESHLINK_ENOMEM,    ///< Out of memory
-       MESHLINK_ENOENT,    ///< Node is not known
-       MESHLINK_EEXIST,    ///< Node already exists
-       MESHLINK_EINTERNAL, ///< MeshLink internal error
-       MESHLINK_ERESOLV,   ///< MeshLink could not resolve a hostname
-       MESHLINK_ESTORAGE,  ///< MeshLink could not load or write data from/to disk
-       MESHLINK_ENETWORK,  ///< MeshLink encountered a network error
-       MESHLINK_EPEER,     ///< A peer caused an error
-       MESHLINK_ENOTSUP,   ///< The operation is not supported in the current configuration of MeshLink
-       MESHLINK_EBUSY      ///< The MeshLink instance is already in use by another process
+       MESHLINK_OK,           ///< Everything is fine
+       MESHLINK_EINVAL,       ///< Invalid parameter(s) to function call
+       MESHLINK_ENOMEM,       ///< Out of memory
+       MESHLINK_ENOENT,       ///< Node is not known
+       MESHLINK_EEXIST,       ///< Node already exists
+       MESHLINK_EINTERNAL,    ///< MeshLink internal error
+       MESHLINK_ERESOLV,      ///< MeshLink could not resolve a hostname
+       MESHLINK_ESTORAGE,     ///< MeshLink could not load or write data from/to disk
+       MESHLINK_ENETWORK,     ///< MeshLink encountered a network error
+       MESHLINK_EPEER,        ///< A peer caused an error
+       MESHLINK_ENOTSUP,      ///< The operation is not supported in the current configuration of MeshLink
+       MESHLINK_EBUSY,        ///< The MeshLink instance is already in use by another process
+       MESHLINK_EBLACKLISTED, ///< The operation is not allowed because the node is blacklisted
 } meshlink_errno_t;
 
 /// Device class
@@ -1171,6 +1172,7 @@ extern void meshlink_set_channel_rcvbuf(struct meshlink_handle *mesh, struct mes
  *                      The pointer may be NULL, in which case incoming data is ignored.
  *  @param data         A pointer to a buffer containing data to already queue for sending, or NULL if there is no data to send.
  *                      After meshlink_send() returns, the application is free to overwrite or free this buffer.
+ *                      If len is 0, the data pointer is copied into the channel's priv member.
  *  @param len          The length of the data, or 0 if there is no data to send.
  *  @param flags        A bitwise-or'd combination of flags that set the semantics for this channel.
  *
@@ -1199,6 +1201,7 @@ extern struct meshlink_channel *meshlink_channel_open_ex(struct meshlink_handle
  *  @param data         A pointer to a buffer containing data to already queue for sending, or NULL if there is no data to send.
  *                      After meshlink_send() returns, the application is free to overwrite or free this buffer.
  *  @param len          The length of the data, or 0 if there is no data to send.
+ *                      If len is 0, the data pointer is copied into the channel's priv member.
  *
  *  @return             A handle for the channel, or NULL in case of an error.
  *                      The handle is valid until meshlink_channel_close() is called.