- 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;
-
- // 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;
- char *proxyuser;
- char *proxypass;
- proxytype_t proxytype;
+
+ // 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;
+ pthread_cond_t adns_cond;
+ meshlink_queue_t adns_queue;
+ meshlink_queue_t adns_done_queue;
+ signal_t adns_signal;