]> git.meshlink.io Git - meshlink/blobdiff - src/meshlink.c
avahi mdns skeleton
[meshlink] / src / meshlink.c
index fcdaff62921275b4915a839648fcac975d0d03b7..d33c0d172914631b6946b8f8b1dfc33aa9147068 100644 (file)
@@ -39,6 +39,7 @@ typedef struct {
 #include "utils.h"
 #include "xalloc.h"
 #include "ed25519/sha512.h"
+#include "discovery.h"
 
 #ifndef MSG_NOSIGNAL
 #define MSG_NOSIGNAL 0
@@ -823,6 +824,10 @@ bool meshlink_start(meshlink_handle_t *mesh) {
 
        mesh->threadstarted=true;
 
+       // Start discovery
+       if(!discovery_start(mesh))
+               return false;
+
        return true;
 }
 
@@ -830,6 +835,9 @@ void meshlink_stop(meshlink_handle_t *mesh) {
        if(!mesh)
                return;
 
+       // Stop discovery
+       discovery_stop(mesh);
+
        // Shut down the listening sockets to signal the main thread to shut down
 
        for(int i = 0; i < mesh->listen_sockets; i++) {