+typedef void (*meshlink_aio_cb_t)(struct meshlink_handle *mesh, struct meshlink_channel *channel, const void *data, size_t len, void *priv);
+
+/// A callback for asynchronous I/O to and from filedescriptors.
+/** This callbacks signals that MeshLink has finished using this filedescriptor.
+ *
+ * @param mesh A handle which represents an instance of MeshLink.
+ * @param channel A handle for the channel which used this filedescriptor.
+ * @param fd The filedescriptor that was used.
+ * @param len The length of the data that was successfully sent or received.
+ * @param priv A private pointer which was set by the application when submitting the buffer.
+ */
+typedef void (*meshlink_aio_fd_cb_t)(struct meshlink_handle *mesh, struct meshlink_channel *channel, int fd, size_t len, void *priv);
+
+/// Transmit data on a channel asynchronously
+/** This registers a buffer that will be used to send data to the remote node.
+ * Multiple buffers can be registered, in which case data will be sent in the order the buffers were registered.
+ * While there are still buffers with unsent data, the poll callback will not be called.
+ *
+ * \memberof meshlink_channel
+ * @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_channel_aio_send() returns, the buffer may not be modified or freed by the application
+ * until the callback routine is called.
+ * @param len The length of the data, or 0 if there is no data to send.
+ * @param cb A pointer to the function which will be called when MeshLink has finished using the buffer.
+ * @param priv A private pointer which is passed unchanged to the callback.
+ *
+ * @return True if the buffer was enqueued, false otherwise.
+ */
+extern bool meshlink_channel_aio_send(struct meshlink_handle *mesh, struct meshlink_channel *channel, const void *data, size_t len, meshlink_aio_cb_t cb, void *priv) __attribute__((__warn_unused_result__));
+
+/// Transmit data on a channel asynchronously from a filedescriptor
+/** This will read up to the specified length number of bytes from the given filedescriptor, and send it over the channel.
+ * The callback may be returned early if there is an error reading from the filedescriptor.
+ * While there is still with unsent data, the poll callback will not be called.
+ *
+ * \memberof meshlink_channel
+ * @param mesh A handle which represents an instance of MeshLink.
+ * @param channel A handle for the channel.
+ * @param fd A file descriptor from which data will be read.
+ * @param len The length of the data, or 0 if there is no data to send.
+ * @param cb A pointer to the function which will be called when MeshLink has finished using the filedescriptor.
+ * @param priv A private pointer which is passed unchanged to the callback.
+ *
+ * @return True if the buffer was enqueued, false otherwise.
+ */
+extern bool meshlink_channel_aio_fd_send(struct meshlink_handle *mesh, struct meshlink_channel *channel, int fd, size_t len, meshlink_aio_fd_cb_t cb, void *priv) __attribute__((__warn_unused_result__));
+
+/// Receive data on a channel asynchronously
+/** This registers a buffer that will be filled with incoming channel data.
+ * Multiple buffers can be registered, in which case data will be received in the order the buffers were registered.
+ * While there are still buffers that have not been filled, the receive callback will not be called.
+ *
+ * \memberof meshlink_channel
+ * @param mesh A handle which represents an instance of MeshLink.
+ * @param channel A handle for the channel.
+ * @param data A pointer to a buffer that will be filled with incoming data.
+ * After meshlink_channel_aio_receive() returns, the buffer may not be modified or freed by the application
+ * until the callback routine is called.
+ * @param len The length of the data.
+ * @param cb A pointer to the function which will be called when MeshLink has finished using the buffer.
+ * @param priv A private pointer which is passed unchanged to the callback.
+ *
+ * @return True if the buffer was enqueued, false otherwise.
+ */
+extern bool meshlink_channel_aio_receive(struct meshlink_handle *mesh, struct meshlink_channel *channel, const void *data, size_t len, meshlink_aio_cb_t cb, void *priv) __attribute__((__warn_unused_result__));
+
+/// Receive data on a channel asynchronously and send it to a filedescriptor
+/** This will read up to the specified length number of bytes from the channel, and send it to the filedescriptor.
+ * The callback may be returned early if there is an error writing to the filedescriptor.
+ * While there is still unread data, the receive callback will not be called.
+ *
+ * \memberof meshlink_channel
+ * @param mesh A handle which represents an instance of MeshLink.
+ * @param channel A handle for the channel.
+ * @param fd A file descriptor to which data will be written.
+ * @param len The length of the data.
+ * @param cb A pointer to the function which will be called when MeshLink has finished using the filedescriptor.
+ * @param priv A private pointer which was set by the application when submitting the buffer.
+ *
+ * @return True if the buffer was enqueued, false otherwise.
+ */
+extern bool meshlink_channel_aio_fd_receive(struct meshlink_handle *mesh, struct meshlink_channel *channel, int fd, size_t len, meshlink_aio_fd_cb_t cb, void *priv) __attribute__((__warn_unused_result__));
+
+/// Get channel flags.
+/** This returns the flags used when opening this channel.
+ *
+ * \memberof meshlink_channel
+ * @param mesh A handle which represents an instance of MeshLink.
+ * @param channel A handle for the channel.
+ *
+ * @return The flags set for this channel.
+ */
+extern uint32_t meshlink_channel_get_flags(struct meshlink_handle *mesh, struct meshlink_channel *channel) __attribute__((__warn_unused_result__));
+
+/// Get the amount of bytes in the send buffer.
+/** This returns the amount of bytes in the send buffer.
+ * These bytes have not been received by the peer yet.
+ *
+ * \memberof meshlink_channel
+ * @param mesh A handle which represents an instance of MeshLink.
+ * @param channel A handle for the channel.
+ *
+ * @return The amount of un-ACKed bytes in the send buffer.
+ */
+extern size_t meshlink_channel_get_sendq(struct meshlink_handle *mesh, struct meshlink_channel *channel) __attribute__((__warn_unused_result__));
+
+/// Get the amount of bytes in the receive buffer.
+/** This returns the amount of bytes in the receive buffer.
+ * These bytes have not been processed by the application yet.
+ *
+ * \memberof meshlink_channel
+ * @param mesh A handle which represents an instance of MeshLink.
+ * @param channel A handle for the channel.
+ *
+ * @return The amount of bytes in the receive buffer.
+ */
+extern size_t meshlink_channel_get_recvq(struct meshlink_handle *mesh, struct meshlink_channel *channel) __attribute__((__warn_unused_result__));
+
+/// Set the connection timeout used for channels to the given node.
+/** This sets the timeout after which unresponsive channels will be reported as closed.
+ * The timeout is set for all current and future channels to the given node.
+ *
+ * \memberof meshlink_node
+ * @param mesh A handle which represents an instance of MeshLink.
+ * @param channel A handle for the channel.
+ * @param timeout The timeout in seconds after which unresponsive channels will be reported as closed.
+ * The default is 60 seconds.
+ */
+extern void meshlink_set_node_channel_timeout(struct meshlink_handle *mesh, struct meshlink_node *node, int timeout);
+
+/// Hint that a hostname may be found at an address
+/** This function indicates to meshlink that the given hostname is likely found
+ * at the given IP address and port.
+ *
+ * \memberof meshlink_node
+ * @param mesh A handle which represents an instance of MeshLink.
+ * @param node A pointer to a struct meshlink_node describing the node to add the address hint for.
+ * @param addr The IP address and port which should be tried for the
+ * given hostname. The caller is free to overwrite or free
+ * this memory once meshlink returns.
+ */
+extern void meshlink_hint_address(struct meshlink_handle *mesh, struct meshlink_node *node, const struct sockaddr *addr);
+
+/// Enable or disable zeroconf discovery of local peers
+/** This controls whether zeroconf discovery using the Catta library will be
+ * enabled to search for peers on the local network. By default, it is enabled.
+ *
+ * \memberof meshlink_handle
+ * @param mesh A handle which represents an instance of MeshLink.
+ * @param enable Set to true to enable discovery, false to disable.
+ */
+extern void meshlink_enable_discovery(struct meshlink_handle *mesh, bool enable);
+
+/// Performs key rotation for an encrypted storage
+/** This rotates the (master) key for an encrypted storage and discards the old key
+ * if the call succeeded. This is an atomic call.
+ *
+ * \memberof meshlink_handle
+ * @param mesh A handle which represents an instance of MeshLink.
+ * @param key A pointer to the new key used to encrypt storage.
+ * @param keylen The length of the new key in bytes.
+ *
+ * @return This function returns true if the key rotation for the encrypted storage succeeds, false otherwise.
+ */
+extern bool meshlink_encrypted_key_rotate(struct meshlink_handle *mesh, const void *key, size_t keylen) __attribute__((__warn_unused_result__));
+
+/// Set device class timeouts
+/** This sets the ping interval and timeout for a given device class.
+ *
+ * \memberof meshlink_handle
+ * @param mesh A handle which represents an instance of MeshLink.
+ * @param devclass The device class to update
+ * @param pinginterval The interval between keepalive packets, in seconds. The default is 60.
+ * @param pingtimeout The required time within which a peer should respond, in seconds. The default is 5.
+ * The timeout must be smaller than the interval.
+ */
+extern void meshlink_set_dev_class_timeouts(struct meshlink_handle *mesh, dev_class_t devclass, int pinginterval, int pingtimeout);
+
+/// Set device class fast retry period
+/** This sets the fast retry period for a given device class.
+ * During this period after the last time the mesh becomes unreachable, connections are tried once a second.
+ *
+ * \memberof meshlink_handle
+ * @param mesh A handle which represents an instance of MeshLink.
+ * @param devclass The device class to update
+ * @param fast_retry_period The period during which fast connection retries are done. The default is 0.
+ */
+extern void meshlink_set_dev_class_fast_retry_period(struct meshlink_handle *mesh, dev_class_t devclass, int fast_retry_period);