]> git.meshlink.io Git - meshlink-tiny/blobdiff - src/meshlink_internal.h
Remove listening sockets.
[meshlink-tiny] / src / meshlink_internal.h
index 17ff9d90ddb99185e17392e34a551e25fcf0e9ef..68d061b680a5177c84a306f27fe8d4ccd08f383c 100644 (file)
 */
 
 #ifdef MESHLINK_H
-#error You must not include both meshlink.h and meshlink_internal.h!
+#error You must not include both meshlink-tiny.h and meshlink_internal.h!
 #endif
 
 #include "system.h"
 
 #include "event.h"
 #include "hash.h"
-#include "meshlink.h"
+#include "meshlink-tiny.h"
 #include "meshlink_queue.h"
 #include "sockaddr.h"
 #include "sptps.h"
@@ -45,13 +45,6 @@ static const char meshlink_udp_label[] = "MeshLink UDP";
 #define MESHLINK_CONFIG_VERSION 2
 #define MESHLINK_INVITATION_VERSION 2
 
-typedef struct listen_socket_t {
-       struct io_t tcp;
-       struct io_t udp;
-       sockaddr_t sa;
-       sockaddr_t broadcast_sa;
-} listen_socket_t;
-
 struct meshlink_open_params {
        char *confbase;
        char *lock_filename;
@@ -93,17 +86,12 @@ struct meshlink_handle {
 
        // The most important network-related members come first
        int reachable;
-       int listen_sockets;
-       listen_socket_t listen_socket[MAXSOCKETS];
 
        meshlink_receive_cb_t receive_cb;
        meshlink_queue_t outpacketqueue;
        signal_t datafromapp;
 
-       hash_t *node_udp_cache;
-
        struct splay_tree_t *nodes;
-       struct splay_tree_t *edges;
 
        struct list_t *connections;
        struct list_t *outgoings;
@@ -148,8 +136,6 @@ struct meshlink_handle {
 
        dev_class_t devclass;
 
-       int udp_choice;
-
        dev_class_traits_t dev_class_traits[DEV_CLASS_COUNT];
 
        int netns;
@@ -167,29 +153,6 @@ struct meshlink_handle {
        pthread_t thread;
        pthread_cond_t cond;
        bool threadstarted;
-
-       // 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;
 };
 
 /// A handle for a MeshLink node.