X-Git-Url: http://git.meshlink.io/?a=blobdiff_plain;f=src%2Fdiscovery.c;h=b6ed37c5ab8a1040fc616b72501181455661289b;hb=53eb21510cf90c47f11d81a5b45a5f4d34d738f1;hp=08ed9aea7ecaeb1a1baaafc42ca7e17af235c504;hpb=2aa7b5a999b17d808c7f32e4d6a19e4beb7e0918;p=meshlink diff --git a/src/discovery.c b/src/discovery.c index 08ed9aea..b6ed37c5 100644 --- a/src/discovery.c +++ b/src/discovery.c @@ -1,11 +1,3 @@ - -#include "meshlink_internal.h" -#include "discovery.h" -#include "sockaddr.h" -#include "logger.h" - -#include - #include #include #include @@ -15,6 +7,13 @@ #include #include +#include "meshlink_internal.h" +#include "discovery.h" +#include "sockaddr.h" +#include "logger.h" + +#include + #include #define MESHLINK_MDNS_SERVICE_TYPE "_%s._tcp" @@ -214,7 +213,7 @@ static void discovery_server_callback(CattaServer *server, CattaServerState stat pthread_mutex_unlock(&(mesh->mesh_mutex)); } -static void discovery_resolve_callback(CattaSServiceResolver *resolver, CattaIfIndex interface, CattaProtocol protocol, CattaResolverEvent event, const char *name, const char *type, const char *domain, const char *host_name, const CattaAddress *address, uint16_t port, CattaStringList *txt, CattaLookupResultFlags flags, void* userdata) +static void discovery_resolve_callback(CattaSServiceResolver *resolver, CattaIfIndex interface_, CattaProtocol protocol, CattaResolverEvent event, const char *name, const char *type, const char *domain, const char *host_name, const CattaAddress *address, uint16_t port, CattaStringList *txt, CattaLookupResultFlags flags, void *userdata) { meshlink_handle_t *mesh = userdata; @@ -350,7 +349,7 @@ static void discovery_resolve_callback(CattaSServiceResolver *resolver, CattaIfI pthread_mutex_unlock(&(mesh->mesh_mutex)); } -static void discovery_browse_callback(CattaSServiceBrowser *browser, CattaIfIndex interface, CattaProtocol protocol, CattaBrowserEvent event, const char *name, const char *type, const char *domain, CattaLookupResultFlags flags, void* userdata) +static void discovery_browse_callback(CattaSServiceBrowser *browser, CattaIfIndex interface_, CattaProtocol protocol, CattaBrowserEvent event, const char *name, const char *type, const char *domain, CattaLookupResultFlags flags, void* userdata) { meshlink_handle_t *mesh = userdata; @@ -383,7 +382,7 @@ static void discovery_browse_callback(CattaSServiceBrowser *browser, CattaIfInde function we free it. Ifthe server is terminated before the callback function is called the server will free the resolver for us. */ - if(!(catta_s_service_resolver_new(mesh->catta_server, interface, protocol, name, type, domain, CATTA_PROTO_UNSPEC, 0, discovery_resolve_callback, mesh))) + if(!(catta_s_service_resolver_new(mesh->catta_server, interface_, protocol, name, type, domain, CATTA_PROTO_UNSPEC, 0, discovery_resolve_callback, mesh))) { logger(mesh, MESHLINK_DEBUG, "Failed to resolve service '%s': %s\n", name, catta_strerror(catta_server_errno(mesh->catta_server))); }