24 #ifndef __ZEROCONFCONNECTOR_H__
25 #define __ZEROCONFCONNECTOR_H__
36 #include <semaphore.h>
38 #include <avahi-client/client.h>
39 #include <avahi-client/lookup.h>
40 #include <avahi-client/publish.h>
42 #include <avahi-common/alternative.h>
43 #include <avahi-common/thread-watch.h>
44 #include <avahi-common/malloc.h>
45 #include <avahi-common/error.h>
47 #define AVAHI_INIT_FAILED 0
48 #define AVAHI_INIT_SUCCEEDED 1
52 bool operator()(
const char* s1,
const char* s2)
const {
53 return strcmp(s1, s2) == 0;
57 typedef std::pair<char *, BootstrapNodeHandle *> LocalNodePair;
60 typedef UNORDERED_MAP<char *, BootstrapNodeHandle*, HASH_NAMESPACE::hash<char *>,
61 EqualStr> LocalBNodeSet;
72 friend void entry_group_callback(AvahiEntryGroup *, AvahiEntryGroupState, AVAHI_GCC_UNUSED
void *);
74 friend void resolv_callback(AvahiServiceResolver *,
75 AVAHI_GCC_UNUSED AvahiIfIndex,
76 AVAHI_GCC_UNUSED AvahiProtocol,
83 uint16_t, AvahiStringList *,
84 AvahiLookupResultFlags,
85 AVAHI_GCC_UNUSED
void*);
86 friend void browse_callback(AvahiServiceBrowser *,
93 AVAHI_GCC_UNUSED AvahiLookupResultFlags,
95 friend void client_callback(AvahiClient *,
97 AVAHI_GCC_UNUSED
void *);
127 int removeNode(
char *name);
149 virtual void initialize();
150 virtual void handleMessage(cMessage *msg);
156 LocalBNodeSet newSet;
158 cMessage *pollingTimer;
161 AvahiEntryGroup *group;
162 AvahiThreadedPoll *threadedPoll;
164 AvahiServiceBrowser *sbMDNS;
165 AvahiServiceBrowser *sbUDNS;
167 const char *serviceType;
169 const char *overlayName;
170 const char *overlayType;