X-Git-Url: http://git.meshlink.io/?a=blobdiff_plain;f=src%2Fmeshlink.h;h=076c7ac7872b65a31fa3c618c885878a0e5b046b;hb=46ef967244d11a2e1dc9c0c61f5d1e2caf08b51a;hp=fdf0896e3e51786612ff47b5f61529786bc8c981;hpb=7593adb9ad9e6ff73afe29e9bd445cea8615a151;p=meshlink diff --git a/src/meshlink.h b/src/meshlink.h index fdf0896e..076c7ac7 100644 --- a/src/meshlink.h +++ b/src/meshlink.h @@ -39,6 +39,11 @@ typedef enum { MESHLINK_ENOMEM, // Out of memory MESHLINK_ENOENT, // Node is not known } meshlink_errno_t; +typedef struct outpacketqueue { + meshlink_node_t *destination; + const void *data; + unsigned int len; +} outpacketqueue_t; #ifndef MESHLINK_INTERNAL_H @@ -191,6 +196,8 @@ extern void meshlink_set_log_cb(meshlink_handle_t *mesh, meshlink_log_level_t le */ extern bool meshlink_send(meshlink_handle_t *mesh, meshlink_node_t *destination, const void *data, unsigned int len); +extern bool meshlink_send_from_queue (meshlink_handle_t *mesh); + /// Get a handle for a specific node. /** This function returns a handle for the node with the given name. * @@ -239,6 +246,16 @@ extern char *meshlink_sign(meshlink_handle_t *mesh, const char *data, size_t len */ extern bool meshlink_verify(meshlink_handle_t *mesh, meshlink_node_t *source, const char *data, size_t len, const char *signature); +/// Add an Address for the local node. +/** This function adds an Address for the local node, which will be used for invitation URLs. + * + * @param mesh A handle which represents an instance of MeshLink. + * @param address A string containing the address, which can be either in numeric format or a hostname. + * + * @return This function returns true if the address was added, false otherwise. + */ +extern bool meshlink_add_address(meshlink_handle_t *mesh, const char *address); + /// Invite another node into the mesh. /** This function generates an invitation that can be used by another node to join the same mesh as the local node. * The generated invitation is a string containing a URL.