X-Git-Url: http://git.meshlink.io/?a=blobdiff_plain;f=src%2Fmeshlink_internal.h;h=f895e02f6b50dffebc28e80232fd0f3ef8141eaa;hb=2224a56ea44bffdafbe29ba7b74d1a0adb0cbd95;hp=e7b184e40caccbe6e3abb319e36eff0f980a2e7e;hpb=477973fd217114dec8218cb7f8d99655272a3669;p=meshlink diff --git a/src/meshlink_internal.h b/src/meshlink_internal.h index e7b184e4..f895e02f 100644 --- a/src/meshlink_internal.h +++ b/src/meshlink_internal.h @@ -42,8 +42,8 @@ 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 +#define MESHLINK_CONFIG_VERSION 2 +#define MESHLINK_INVITATION_VERSION 2 struct CattaServer; struct CattaSServiceBrowser; @@ -82,6 +82,7 @@ struct meshlink_open_params { typedef struct { int pinginterval; int pingtimeout; + int fast_retry_period; unsigned int min_connects; unsigned int max_connects; int edge_weight; @@ -94,13 +95,14 @@ struct meshlink_handle { void *priv; // private members - pthread_mutex_t mesh_mutex; + pthread_mutex_t mutex; event_loop_t loop; struct node_t *self; meshlink_log_cb_t log_cb; meshlink_log_level_t log_level; // The most important network-related members come first + int reachable; int listen_sockets; listen_socket_t listen_socket[MAXSOCKETS]; @@ -128,11 +130,13 @@ struct meshlink_handle { time_t connection_burst_time; time_t last_config_check; time_t last_hard_try; + time_t last_unreachable; timeout_t pingtimer; timeout_t periodictimer; struct connection_t *everyone; uint64_t prng_state[4]; + uint32_t session_id; int next_pit; int pits[10]; @@ -164,11 +168,11 @@ struct meshlink_handle { bool default_blacklist; bool discovery; // Whether Catta is enabled or not - + bool inviter_commits_first; // Configuration char *confbase; - FILE *conffile; + FILE *lockfile; void *config_key; // Thread management @@ -188,17 +192,6 @@ struct meshlink_handle { char *catta_servicetype; unsigned int catta_interfaces; - // State used for meshlink_join() - int sock; - char cookie[18], hash[18]; - bool success; - sptps_t sptps; - char *data; - size_t thedatalen; - size_t blen; - char line[4096]; - char buffer[4096]; - // Proxy configuration, currently not exposed. char *proxyhost; char *proxyport;