diff options
Diffstat (limited to 'Swiften/Network/StaticDomainNameResolver.h')
-rw-r--r-- | Swiften/Network/StaticDomainNameResolver.h | 27 |
1 files changed, 22 insertions, 5 deletions
diff --git a/Swiften/Network/StaticDomainNameResolver.h b/Swiften/Network/StaticDomainNameResolver.h index 8688429..ed8c613 100644 --- a/Swiften/Network/StaticDomainNameResolver.h +++ b/Swiften/Network/StaticDomainNameResolver.h @@ -3,21 +3,38 @@ #include <vector> #include <map> +#include "Swiften/Network/HostAddress.h" +#include "Swiften/Network/HostAddressPort.h" #include "Swiften/Network/DomainNameResolver.h" +#include "Swiften/Network/DomainNameServiceQuery.h" +#include "Swiften/Network/DomainNameAddressQuery.h" namespace Swift { class String; class StaticDomainNameResolver : public DomainNameResolver { public: - StaticDomainNameResolver(); + typedef std::map<String, HostAddress> AddressesMap; + typedef std::vector< std::pair<String, DomainNameServiceQuery::Result> > ServicesCollection; - virtual std::vector<HostAddressPort> resolve(const String& domain); + public: + void addAddress(const String& domain, const HostAddress& address); + void addService(const String& service, const DomainNameServiceQuery::Result& result); + void addXMPPClientService(const String& domain, const HostAddressPort&); + + const AddressesMap& getAddresses() const { + return addresses; + } + + const ServicesCollection& getServices() const { + return services; + } - void addDomain(const String& domain, const HostAddressPort& addressPort); + virtual boost::shared_ptr<DomainNameServiceQuery> createServiceQuery(const String& name); + virtual boost::shared_ptr<DomainNameAddressQuery> createAddressQuery(const String& name); private: - typedef std::vector< std::pair<String, HostAddressPort> > DomainCollection; - DomainCollection domains; + AddressesMap addresses; + ServicesCollection services; }; } |