X-Git-Url: http://git.meshlink.io/?a=blobdiff_plain;f=src%2Fmeshlink_internal.h;h=8a632e26f0527e676c6cdbf662a05df70fd73ce8;hb=e25f5166a3edc98f4a333c98881d4899635f1144;hp=15edba9ab9a1bf1c3452635c888dac1abe8bb9c7;hpb=42cef01039177f3c762001439c8fb6bbdcd6e159;p=meshlink diff --git a/src/meshlink_internal.h b/src/meshlink_internal.h index 15edba9a..8a632e26 100644 --- a/src/meshlink_internal.h +++ b/src/meshlink_internal.h @@ -55,7 +55,6 @@ typedef struct listen_socket_t { struct io_t udp; sockaddr_t sa; sockaddr_t broadcast_sa; - bool bindto; } listen_socket_t; typedef enum proxytype_t { @@ -82,6 +81,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; @@ -99,8 +99,10 @@ struct meshlink_handle { struct node_t *self; meshlink_log_cb_t log_cb; meshlink_log_level_t log_level; + void *packet; // The most important network-related members come first + int reachable; int listen_sockets; listen_socket_t listen_socket[MAXSOCKETS]; @@ -126,8 +128,8 @@ struct meshlink_handle { int contradicting_del_edge; int sleeptime; 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; @@ -165,12 +167,14 @@ struct meshlink_handle { bool default_blacklist; bool discovery; // Whether Catta is enabled or not - + bool inviter_commits_first; // Configuration char *confbase; FILE *lockfile; void *config_key; + char *external_address_url; + struct list_t *invitation_addresses; // Thread management pthread_t thread; @@ -189,16 +193,12 @@ 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]; + // ADNS + pthread_t adns_thread; + pthread_cond_t adns_cond; + meshlink_queue_t adns_queue; + meshlink_queue_t adns_done_queue; + signal_t adns_signal; // Proxy configuration, currently not exposed. char *proxyhost; @@ -267,6 +267,6 @@ static inline int prng(meshlink_handle_t *mesh, uint64_t max) { } /// Fudge value of ~0.1 seconds, in microseconds. -static const unsigned int TIMER_FUDGE = 0x20000; +static const unsigned int TIMER_FUDGE = 0x8000000; #endif