X-Git-Url: http://git.meshlink.io/?a=blobdiff_plain;f=src%2Fmeshlink_internal.h;h=dd9c113831d368909d93bf852dc48c1e6cb234b5;hb=c31f626c3a252a0d6805a5f3ca9154d934ea41f5;hp=d6dc87d04f414d7149fdfea3e190342cb728fa15;hpb=8d4b96efb7955eaa96174af4804597f92e124041;p=meshlink diff --git a/src/meshlink_internal.h b/src/meshlink_internal.h index d6dc87d0..dd9c1138 100644 --- a/src/meshlink_internal.h +++ b/src/meshlink_internal.h @@ -45,11 +45,6 @@ static const char meshlink_udp_label[] = "MeshLink UDP"; #define MESHLINK_CONFIG_VERSION 2 #define MESHLINK_INVITATION_VERSION 2 -struct CattaServer; -struct CattaSServiceBrowser; -struct CattaSimplePoll; -struct CattaSEntryGroup; - typedef struct listen_socket_t { struct io_t tcp; struct io_t udp; @@ -74,6 +69,7 @@ typedef struct { int pinginterval; int pingtimeout; int fast_retry_period; + int maxtimeout; unsigned int min_connects; unsigned int max_connects; int edge_weight; @@ -134,11 +130,14 @@ struct meshlink_handle { // Infrequently used callbacks meshlink_node_status_cb_t node_status_cb; + meshlink_node_status_cb_t meta_status_cb; meshlink_node_pmtu_cb_t node_pmtu_cb; + meshlink_channel_listen_cb_t channel_listen_cb; meshlink_channel_accept_cb_t channel_accept_cb; meshlink_node_duplicate_cb_t node_duplicate_cb; meshlink_connection_try_cb_t connection_try_cb; meshlink_error_cb_t error_cb; + meshlink_blacklisted_cb_t blacklisted_cb; // Mesh parameters char *appname; @@ -150,7 +149,6 @@ struct meshlink_handle { dev_class_t devclass; int invitation_timeout; - int maxtimeout; int udp_choice; dev_class_traits_t dev_class_traits[DEV_CLASS_COUNT]; @@ -158,7 +156,6 @@ struct meshlink_handle { int netns; bool default_blacklist; - bool discovery; // Whether Catta is enabled or not bool inviter_commits_first; // Configuration @@ -171,19 +168,23 @@ struct meshlink_handle { // Thread management pthread_t thread; pthread_cond_t cond; - pthread_mutex_t discovery_mutex; - pthread_cond_t discovery_cond; bool threadstarted; - bool discovery_threadstarted; - - // Catta - pthread_t discovery_thread; - struct CattaServer *catta_server; - struct CattaSServiceBrowser *catta_browser; - struct CattaSimplePoll *catta_poll; - struct CattaSEntryGroup *catta_group; - char *catta_servicetype; - unsigned int catta_interfaces; + + // mDNS discovery + struct { + bool enabled; + io_t pfroute_io; + int *ifaces; + struct discovery_address *addresses; + int iface_count; + int address_count; + io_t sockets[2]; + time_t last_update; +#ifdef __APPLE__ + pthread_t thread; + void *runloop; +#endif + } discovery; // ADNS pthread_t adns_thread;