11 #include "network/ZeroconfBrowser.h" 12 #include "threads/CriticalSection.h" 13 #include "threads/Thread.h" 19 #include <avahi-client/client.h> 20 #include <avahi-client/lookup.h> 21 #include <avahi-common/defs.h> 22 #include <avahi-common/thread-watch.h> 34 bool doAddServiceType(
const std::string& fcr_service_type)
override;
35 bool doRemoveServiceType(
const std::string& fcr_service_type)
override;
37 std::vector<CZeroconfBrowser::ZeroconfService> doGetFoundServices()
override;
43 static void clientCallback(AvahiClient *c, AvahiClientState state, AVAHI_GCC_UNUSED
void * userdata);
44 static void browseCallback(
45 AvahiServiceBrowser *b,
46 AvahiIfIndex interface,
47 AvahiProtocol protocol,
48 AvahiBrowserEvent event,
52 AVAHI_GCC_UNUSED AvahiLookupResultFlags flags,
54 static void resolveCallback(
55 AvahiServiceResolver *r,
56 AvahiIfIndex interface,
57 AvahiProtocol protocol,
58 AvahiResolverEvent event,
62 const char *host_name,
63 const AvahiAddress *address,
66 AvahiLookupResultFlags flags,
67 AVAHI_GCC_UNUSED
void* userdata);
70 static AvahiServiceBrowser* createServiceBrowser(
const std::string& fcr_service_type, AvahiClient* fp_client,
void* fp_userdata);
73 AvahiClient* mp_client = 0 ;
74 AvahiThreadedPoll* mp_poll = 0 ;
76 typedef std::map<std::string, AvahiServiceBrowser*> tBrowserMap;
77 tBrowserMap m_browsers;
81 std::set<AvahiServiceBrowser*> m_all_for_now_browsers;
85 struct AvahiSpecificInfos
87 AvahiIfIndex interface;
88 AvahiProtocol protocol;
90 typedef std::map<CZeroconfBrowser::ZeroconfService, AvahiSpecificInfos> tDiscoveredServices;
91 tDiscoveredServices m_discovered_services;
This is an Event class built from a ConditionVariable.
Definition: Event.h:35
Definition: ZeroconfBrowserAvahi.h:25
CZeroconfBrowserAvahi()
Definition: ZeroconfBrowserAvahi.cpp:39
Definition: ZeroconfBrowser.h:27
this class provides support for zeroconf browsing
Definition: ZeroconfBrowser.h:24