summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swiften/LinkLocal/DNSSDService.h')
-rw-r--r--Swiften/LinkLocal/DNSSDService.h33
1 files changed, 33 insertions, 0 deletions
diff --git a/Swiften/LinkLocal/DNSSDService.h b/Swiften/LinkLocal/DNSSDService.h
index 214cad4..6a9425f 100644
--- a/Swiften/LinkLocal/DNSSDService.h
+++ b/Swiften/LinkLocal/DNSSDService.h
@@ -4,6 +4,7 @@
#include <map>
#include "Swiften/Base/String.h"
+#include "Swiften/LinkLocal/LinkLocalServiceInfo.h"
namespace Swift {
class LinkLocalServiceInfo;
@@ -12,21 +13,53 @@ namespace Swift {
public:
struct Service {
Service(const String& name, const String& type, const String& domain, int networkInterface) : name(name), type(type), domain(domain), networkInterface(networkInterface) {}
+ bool operator==(const Service& o) const {
+ return name == o.name && type == o.type && domain == o.domain && (networkInterface != 0 && o.networkInterface != 0 ? networkInterface == o.networkInterface : true);
+ }
+ bool operator<(const Service& o) const {
+ if (o.name == name) {
+ if (o.type == type) {
+ if (o.domain == domain) {
+ return networkInterface < o.networkInterface;
+ }
+ else {
+ return domain < o.domain;
+ }
+ }
+ else {
+ return type < o.type;
+ }
+ }
+ else {
+ return o.name < name;
+ }
+ }
+
String name;
String type;
String domain;
int networkInterface;
};
+ struct ResolveResult {
+ ResolveResult(const String& host, int port, const LinkLocalServiceInfo& info) : host(host), port(port), info(info) {}
+ String host;
+ int port;
+ LinkLocalServiceInfo info;
+ };
+
virtual ~DNSSDService();
virtual void registerService(const String& name, int port, const LinkLocalServiceInfo&) = 0;
+ virtual void startResolvingService(const Service&) = 0;
+ virtual void stopResolvingService(const Service&) = 0;
virtual void unregisterService() = 0;
virtual void start() = 0;
boost::signal<void (const Service&)> onServiceAdded;
boost::signal<void (const Service&)> onServiceRemoved;
boost::signal<void (const Service&)> onServiceRegistered;
+ boost::signal<void (const Service&, const ResolveResult&)> onServiceResolved;
boost::signal<void ()> onError;
};
}