+extern void meshlink_blacklist(meshlink_handle_t *mesh, meshlink_node_t *node);
+
+/// Whitelist a node on the mesh.
+/** This function causes the local node to whitelist a previously blacklisted node.
+ * The local node will allow connections to and from that node,
+ * and will send data to it and accept any data received from it.
+ *
+ * @param mesh A handle which represents an instance of MeshLink.
+ * @param node A pointer to a meshlink_node_t describing the node to be blacklisted.
+ */
+extern void meshlink_blacklist(meshlink_handle_t *mesh, meshlink_node_t *node);
+
+/// A callback for accepting incoming channels.
+/** This function is called whenever a remote node wants to open a channel to the local node.
+ * The application then has to decide whether to accept or reject this channel.
+ *
+ * The callback is run in MeshLink's own thread.
+ * It is therefore important that the callback return quickly and uses apprioriate methods (queues, pipes, locking, etc.)
+ * to hand any data over to the application's thread.
+ *
+ * @param mesh A handle which represents an instance of MeshLink.
+ * @param channel A handle for the incoming channel.
+ * If the application accepts the incoming channel by returning true,
+ * then this handle is valid until meshlink_channel_close() is called on it.
+ * If the application rejects the incoming channel by returning false,
+ * then this handle is invalid after the callback returns
+ * (the callback does not need to call meshlink_channel_close() itself in this case).
+ * @param node The node from which this channel is being initiated.
+ * The pointer is guaranteed to be valid until meshlink_close() is called.
+ * @param port The port number the peer wishes to connect to.
+ * @param data A pointer to a buffer containing data already received, or NULL in case no data has been received yet. (Not yet used.)
+ * The pointer is only valid during the lifetime of the callback.
+ * The callback should mempcy() the data if it needs to be available outside the callback.
+ * @param len The length of the data, or 0 in case no data has been received yet. (Not yet used.)
+ *
+ * @return This function should return true if the application accepts the incoming channel, false otherwise.
+ * If returning false, the channel is invalid and may not be used anymore.
+ */
+typedef bool (*meshlink_channel_accept_cb_t)(meshlink_handle_t *mesh, meshlink_channel_t *channel, meshlink_node_t *node, uint16_t port, const void *data, size_t len);
+
+/// A callback for receiving data from a channel.
+/** This function is called whenever data is received from a remote node on a channel.
+ *
+ * This function is also called in case the channel has been closed by the remote node, or when the channel is terminated abnormally.
+ * In both cases, @a data @a will be NULL and @a len @a will be 0, and meshlink_errno will be set.
+ * In any case, the @a channel @a handle will still be valid until the application calls meshlink_close().
+ *
+ * @param mesh A handle which represents an instance of MeshLink.
+ * @param channel A handle for the channel.
+ * @param data A pointer to a buffer containing data sent by the source, or NULL in case of an error.
+ * The pointer is only valid during the lifetime of the callback.
+ * The callback should mempcy() the data if it needs to be available outside the callback.
+ * @param len The length of the data, or 0 in case of an error.
+ */
+typedef void (*meshlink_channel_receive_cb_t)(meshlink_handle_t *mesh, meshlink_channel_t *channel, const void *data, size_t len);
+
+/// Set the accept callback.
+/** This functions sets the callback that is called whenever another node sends data to the local node.
+ * The callback is run in MeshLink's own thread.
+ * It is therefore important that the callback uses apprioriate methods (queues, pipes, locking, etc.)
+ * to hand the data over to the application's thread.
+ * The callback should also not block itself and return as quickly as possible.
+ *
+ * If no accept callback is set, incoming channels are rejected.
+ *
+ * @param mesh A handle which represents an instance of MeshLink.
+ * @param cb A pointer to the function which will be called when another node sends data to the local node.
+ * If a NULL pointer is given, the callback will be disabled.
+ */
+extern void meshlink_set_channel_accept_cb(meshlink_handle_t *mesh, meshlink_channel_accept_cb_t cb);
+
+/// Set the receive callback.
+/** This functions sets the callback that is called whenever another node sends data to the local node.
+ * The callback is run in MeshLink's own thread.
+ * It is therefore important that the callback uses apprioriate methods (queues, pipes, locking, etc.)
+ * to hand the data over to the application's thread.
+ * The callback should also not block itself and return as quickly as possible.
+ *
+ * @param mesh A handle which represents an instance of MeshLink.
+ * @param channel A handle for the channel.
+ * @param cb A pointer to the function which will be called when another node sends data to the local node.
+ * If a NULL pointer is given, the callback will be disabled and incoming data is ignored.
+ */
+extern void meshlink_set_channel_receive_cb(meshlink_handle_t *mesh, meshlink_channel_t *channel, meshlink_channel_receive_cb_t cb);
+
+/// Open a reliable stream channel to another node.
+/** This function is called whenever a remote node wants to open a channel to the local node.
+ * The application then has to decide whether to accept or reject this channel.
+ *
+ * This function returns a pointer to a struct meshlink_channel that will be allocated by MeshLink.
+ * When the application does no longer need to use this channel, it must call meshlink_close()
+ * to free its resources.
+ *
+ * @param mesh A handle which represents an instance of MeshLink.
+ * @param node The node to which this channel is being initiated.
+ * @param port The port number the peer wishes to connect to.
+ * @param cb A pointer to the function which will be called when the remote node sends data to the local node.
+ * 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.
+ * @param len The length of the data, or 0 if there is no data to send.
+ *
+ * @return A handle for the channel, or NULL in case of an error.
+ * The handle is valid until meshlink_channel_close() is called.
+ */
+extern meshlink_channel_t *meshlink_channel_open(meshlink_handle_t *mesh, meshlink_node_t *node, uint16_t port, meshlink_channel_receive_cb_t cb, const void *data, size_t len);
+
+/// Partially close a reliable stream channel.
+/** This shuts down the read or write side of a channel, or both, without closing the handle.
+ * It can be used to inform the remote node that the local node has finished sending all data on the channel,
+ * but still allows waiting for incoming data from the remote node.
+ *
+ * Shutting down the receive direction is also possible, and is equivalent to setting the receive callback to NULL.
+ *
+ * @param mesh A handle which represents an instance of MeshLink.
+ * @param channel A handle for the channel.
+ * @param direction Must be one of SHUT_RD, SHUT_WR or SHUT_RDWR, otherwise this call will not have any affect.
+ */
+extern void meshlink_channel_shutdown(meshlink_handle_t *mesh, meshlink_channel_t *channel, int direction);
+
+/// Close a reliable stream channel.
+/** This informs the remote node that the local node has finished sending all data on the channel.
+ * It also causes the local node to stop accepting incoming data from the remote node.
+ * It will free the struct meshlink_channel and all associated resources.
+ * Afterwards, the channel handle is invalid and must not be used any more.
+ *
+ * It is allowed to call this function at any time on a valid handle, even inside callback functions.
+ * If called with a valid handle, this function always succeeds, otherwise the result is undefined.
+ *
+ * @param mesh A handle which represents an instance of MeshLink.
+ * @param channel A handle for the channel.
+ */
+extern void meshlink_channel_close(meshlink_handle_t *mesh, meshlink_channel_t *channel);
+
+/// Transmit data on a channel
+/** This queues data to send to the remote node.
+ *
+ * @param mesh A handle which represents an instance of MeshLink.
+ * @param channel A handle for the channel.
+ * @param data A pointer to a buffer containing data sent by the source, 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.
+ *
+ * @return The amount of data that was queued, which can be less than len, or a negative value in case of an error.
+ */
+extern ssize_t meshlink_channel_send(meshlink_handle_t *mesh, meshlink_channel_t *channel, const void *data, size_t len);
+
+#ifdef __cplusplus
+}
+#endif