]> git.meshlink.io Git - meshlink/blobdiff - src/meshlink_internal.h
Add support for opening a MeshLink instance without permanent storage.
[meshlink] / src / meshlink_internal.h
index c6c99541d66b0d7fa622c097313e1090b19dc09c..4410505300a928da3427981f653fe777386b3113 100644 (file)
@@ -37,6 +37,9 @@ static const char meshlink_invitation_label[] = "MeshLink invitation";
 static const char meshlink_tcp_label[] = "MeshLink TCP";
 static const char meshlink_udp_label[] = "MeshLink UDP";
 
+#define MESHLINK_CONFIG_VERSION 1
+#define MESHLINK_INVITATION_VERSION 1
+
 struct CattaServer;
 struct CattaSServiceBrowser;
 struct CattaSimplePoll;
@@ -63,9 +66,10 @@ struct meshlink_handle {
        void *priv;
 
        char *appname;
-       dev_class_t devclass;
+       int32_t devclass;
 
        char *confbase;
+       FILE *conffile;
 
        meshlink_receive_cb_t receive_cb;
        meshlink_node_status_cb_t node_status_cb;
@@ -73,6 +77,7 @@ struct meshlink_handle {
        meshlink_log_level_t log_level;
 
        meshlink_channel_accept_cb_t channel_accept_cb;
+       meshlink_node_duplicate_cb_t node_duplicate_cb;
 
        pthread_t thread;
        bool threadstarted;
@@ -84,7 +89,6 @@ struct meshlink_handle {
 
        struct node_t *self;
 
-       struct splay_tree_t *config;
        struct splay_tree_t *edges;
        struct splay_tree_t *nodes;
 
@@ -119,6 +123,7 @@ struct meshlink_handle {
 
        hash_t *node_udp_cache;
        struct connection_t *everyone;
+       struct ecdsa *private_key;
        struct ecdsa *invitation_key;
        int invitation_timeout;
 
@@ -143,6 +148,8 @@ struct meshlink_handle {
        struct CattaSimplePoll *catta_poll;
        struct CattaSEntryGroup *catta_group;
        char *catta_servicetype;
+
+       void *config_key;
 };
 
 /// A handle for a MeshLink node.
@@ -172,6 +179,7 @@ extern void update_node_status(meshlink_handle_t *mesh, struct node_t *n);
 extern meshlink_log_level_t global_log_level;
 extern meshlink_log_cb_t global_log_cb;
 extern int check_port(meshlink_handle_t *mesh);
+extern void handle_duplicate_node(meshlink_handle_t *mesh, struct node_t *n);
 
 /// Device class traits
 typedef struct {