diff options
author | Kevin Smith <git@kismith.co.uk> | 2009-07-31 18:38:11 (GMT) |
---|---|---|
committer | Kevin Smith <git@kismith.co.uk> | 2009-07-31 18:38:11 (GMT) |
commit | 99b65c4dd72105755a7cf95297c9cf69dcbc6446 (patch) | |
tree | c6c862f6ef33b2260c44c0229b29f65351223e7c /Swiften/LinkLocal/DNSSDService.h | |
parent | fed11bbc3bffd383e097ea63bb92442ce2daf6ed (diff) | |
parent | aa60aa80d2d170a536c246ef6c221f92de7dd8ed (diff) | |
download | swift-contrib-99b65c4dd72105755a7cf95297c9cf69dcbc6446.zip swift-contrib-99b65c4dd72105755a7cf95297c9cf69dcbc6446.tar.bz2 |
Merge commit 'origin/master' into roster
Diffstat (limited to 'Swiften/LinkLocal/DNSSDService.h')
-rw-r--r-- | Swiften/LinkLocal/DNSSDService.h | 74 |
1 files changed, 0 insertions, 74 deletions
diff --git a/Swiften/LinkLocal/DNSSDService.h b/Swiften/LinkLocal/DNSSDService.h deleted file mode 100644 index 9689352..0000000 --- a/Swiften/LinkLocal/DNSSDService.h +++ /dev/null @@ -1,74 +0,0 @@ -#pragma once - -#include <boost/signal.hpp> -#include <map> - -#include "Swiften/Base/String.h" -#include "Swiften/LinkLocal/LinkLocalServiceInfo.h" - -namespace Swift { - class LinkLocalServiceInfo; - class HostAddress; - - class DNSSDService { - 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 start() = 0; - virtual void stop() = 0; - - virtual void registerService(const String& name, int port, const LinkLocalServiceInfo&) = 0; - virtual void updateService(const LinkLocalServiceInfo&) = 0; - virtual void unregisterService() = 0; - - virtual void startResolvingService(const Service&) = 0; - virtual void stopResolvingService(const Service&) = 0; - - virtual void resolveHostname(const String& hostname, int interfaceIndex = 0) = 0; - - boost::signal<void ()> onStarted; - boost::signal<void (bool)> onStopped; - 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 (const String&, const boost::optional<HostAddress>&)> onHostnameResolved; - }; -} |