summaryrefslogtreecommitdiffstats
blob: 3437c583e8f4412cf285fa75f8080c8b2095ab8b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#pragma once

#include <boost/signal.hpp>
#include <map>

#include "Swiften/Base/String.h"

namespace Swift {
	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) {}
				String name;
				String type;
				String domain;
				int networkInterface;
			};

			virtual ~DNSSDService();

			virtual void registerService(const String& name, int port, const std::map<String,String>& properties) = 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 ()> onError;
	};
}