|
|
|
@ -38,6 +38,7 @@
|
|
|
|
|
|
|
|
|
|
namespace DNSSD
|
|
|
|
|
{
|
|
|
|
|
#ifdef HAVE_DNSSD
|
|
|
|
|
#ifdef AVAHI_API_0_6
|
|
|
|
|
void resolve_callback(AvahiServiceResolver*, AvahiIfIndex, AvahiProtocol proto, AvahiResolverEvent e,
|
|
|
|
|
const char* name, const char* type, const char* domain, const char* hostname, const AvahiAddress* a,
|
|
|
|
@ -47,6 +48,7 @@ void resolve_callback(AvahiServiceResolver*, AvahiIfIndex, AvahiProtocol proto,
|
|
|
|
|
const char* name, const char* type, const char* domain, const char* hostname, const AvahiAddress* a,
|
|
|
|
|
uint16_t port, AvahiStringList* txt, void* context);
|
|
|
|
|
#endif
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
class RemoteServicePrivate : public Responder
|
|
|
|
|
{
|
|
|
|
@ -106,6 +108,7 @@ void RemoteService::resolveAsync()
|
|
|
|
|
if (d->m_running) return;
|
|
|
|
|
d->m_resolved = false;
|
|
|
|
|
// FIXME: first protocol should be set?
|
|
|
|
|
#ifdef HAVE_DNSSD
|
|
|
|
|
#ifdef AVAHI_API_0_6
|
|
|
|
|
d->m_resolver = avahi_service_resolver_new(Responder::self().client(),AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC,
|
|
|
|
|
m_serviceName.utf8(), m_type.ascii(), domainToDNS(m_domain), AVAHI_PROTO_UNSPEC, AVAHI_LOOKUP_NO_ADDRESS,
|
|
|
|
@ -113,6 +116,7 @@ void RemoteService::resolveAsync()
|
|
|
|
|
#else
|
|
|
|
|
d->m_resolver = avahi_service_resolver_new(Responder::self().client(),AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC,
|
|
|
|
|
m_serviceName.utf8(), m_type.ascii(), m_domain.utf8(), AVAHI_PROTO_UNSPEC, resolve_callback, this);
|
|
|
|
|
#endif
|
|
|
|
|
#endif
|
|
|
|
|
if (d->m_resolver) d->m_running=true;
|
|
|
|
|
else emit resolved(false);
|
|
|
|
@ -164,6 +168,7 @@ QDataStream & operator>> (QDataStream & s, RemoteService & a)
|
|
|
|
|
return s;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#ifdef HAVE_DNSSD
|
|
|
|
|
#ifdef AVAHI_API_0_6
|
|
|
|
|
void resolve_callback(AvahiServiceResolver*, AvahiIfIndex, AvahiProtocol, AvahiResolverEvent e,
|
|
|
|
|
const char*, const char*, const char*, const char* hostname, const AvahiAddress*,
|
|
|
|
@ -191,6 +196,7 @@ void resolve_callback(AvahiServiceResolver*, AvahiIfIndex, AvahiProtocol, AvahiR
|
|
|
|
|
ResolveEvent rev(DNSToDomain(hostname),port,map);
|
|
|
|
|
QApplication::sendEvent(obj, &rev);
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|