From dcd34d37287adb6aa03d32edd17fc8015b52feb8 Mon Sep 17 00:00:00 2001 From: Adam Date: Sat, 15 Dec 2012 01:33:31 -0500 Subject: Move DNS handling to a module --- modules/commands/os_dns.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'modules/commands') diff --git a/modules/commands/os_dns.cpp b/modules/commands/os_dns.cpp index 6e5689396..ec72f5a5d 100644 --- a/modules/commands/os_dns.cpp +++ b/modules/commands/os_dns.cpp @@ -6,6 +6,9 @@ */ #include "module.h" +#include "../extra/dns.h" + +static ServiceReference dnsmanager("DNS::Manager", "dns/manager"); class DNSServer; static std::vector dns_servers; @@ -44,8 +47,8 @@ class DNSServer : public Serializable void Pool(bool p) { pooled = p; - if (DNS::Engine) - DNS::Engine->UpdateSerial(); + if (dnsmanager) + dnsmanager->UpdateSerial(); } @@ -220,8 +223,8 @@ class CommandOSDNS : public Command source.Reply(_("Added IP %s to %s."), params[2].c_str(), s->GetName().c_str()); Log(LOG_ADMIN, source, this) << "to add IP " << params[2] << " to " << s->GetName(); - if (s->Pooled()) - DNS::Engine->UpdateSerial(); + if (s->Pooled() && dnsmanager) + dnsmanager->UpdateSerial(); } void DelIP(CommandSource &source, const std::vector ¶ms) @@ -247,8 +250,8 @@ class CommandOSDNS : public Command s->Pool(false); } - if (s->Pooled()) - DNS::Engine->UpdateSerial(); + if (s->Pooled() && dnsmanager) + dnsmanager->UpdateSerial(); return; } -- cgit