OpenSDN source code
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
named_config.cc
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
3  */
4 
5 #include <cstdio>
6 #include <iomanip>
7 #include <assert.h>
8 #include <errno.h>
9 #include <sys/types.h>
10 #include <dirent.h>
11 #include "base/logging.h"
12 #include <base/contrail_ports.h>
13 #include <bind/bind_util.h>
14 #include <cfg/dns_config.h>
15 #include <mgr/dns_oper.h>
16 #include "named_config.h"
17 #include <cmn/dns.h>
18 
19 using namespace std;
20 
22 const string NamedConfig::NamedZoneFileSuffix = "zone";
23 const string NamedConfig::NamedZoneNSPrefix = "contrail-ns";
24 const string NamedConfig::NamedZoneMXPrefix = "contrail-mx";
25 const char NamedConfig::pid_file_name[] = "contrail-named.pid";
26 const char NamedConfig::sessionkey_file_name[] = "session.key";
27 
28 void NamedConfig::Init(const std::string& named_config_dir,
29  const std::string& named_config_file,
30  const std::string& named_log_file,
31  const std::string& rndc_config_file,
32  const std::string& rndc_secret,
33  const std::string& named_max_cache_size) {
34  assert(singleton_ == NULL);
35  singleton_ = new NamedConfig(named_config_dir, named_config_file,
36  named_log_file, rndc_config_file, rndc_secret,
37  named_max_cache_size);
38  singleton_->Reset();
39 }
40 
42  assert(singleton_);
43  delete singleton_;
44 }
45 
46 // Reset bind config
48  reset_flag_ = true;
49  CreateRndcConf();
50  UpdateNamedConf();
51  DIR *dir = opendir(named_config_dir_.c_str());
52  if (dir) {
53  struct dirent *file;
54  while ((file = readdir(dir)) != NULL) {
55  std::string str(named_config_dir_);
56  str.append(file->d_name);
57  if (str.find(".zone") != std::string::npos) {
58  remove(str.c_str());
59  }
60  }
61  closedir(dir);
62  }
63  reset_flag_ = false;
64 }
65 
67  UpdateNamedConf(vdns);
68 }
69 
71  UpdateNamedConf(vdns);
72  std::string old_domain = vdns->GetOldDomainName();
73  if (vdns->GetDomainName() != old_domain) {
74  ZoneList zones;
75  zones.push_back(old_domain);
76  RemoveZoneFiles(vdns, zones);
77  }
78 }
79 
81  UpdateNamedConf(vdns);
82 }
83 
85  all_zone_files_ = true;
86  UpdateNamedConf();
87  all_zone_files_ = false;
88 }
89 
90 void NamedConfig::AddZone(const Subnet &subnet, const VirtualDnsConfig *vdns) {
91  ZoneList zones;
92  subnet.GetReverseZones(zones);
93  // Ignore zone files which already exist
94  for (unsigned int i = 0; i < zones.size();) {
95  std::ifstream file(zones[i].c_str());
96  if (file.is_open()) {
97  if (file.good()) {
98  zones.erase(zones.begin() + i);
99  file.close();
100  continue;
101  }
102  file.close();
103  }
104  i++;
105  }
106  AddZoneFiles(zones, vdns);
107  UpdateNamedConf();
108 }
109 
110 void NamedConfig::DelZone(const Subnet &subnet, const VirtualDnsConfig *vdns) {
111  UpdateNamedConf();
112  ZoneList vdns_zones, snet_zones;
113  MakeZoneList(vdns, vdns_zones);
114  subnet.GetReverseZones(snet_zones);
115  // Ignore zones which are still in use
116  for (unsigned int i = 0; i < snet_zones.size();) {
117  unsigned int j;
118  for (j = 0; j < vdns_zones.size(); j++) {
119  if (snet_zones[i] == vdns_zones[j]) {
120  snet_zones.erase(snet_zones.begin() + i);
121  break;
122  }
123  }
124  if (j == vdns_zones.size())
125  i++;
126  }
127  RemoveZoneFiles(vdns, snet_zones);
128 }
129 
131  CreateNamedConf(updated_vdns);
132  sync();
133 
134  ifstream pyscript("/etc/contrail/dns/applynamedconfig.py");
135  if (!pyscript.good()) {
136  std::stringstream str;
137  str << "/usr/bin/contrail-rndc -c " << rndc_config_file_ << " -p ";
138  str << ContrailPorts::DnsRndc();
139  str << " reconfig";
140  int res = system(str.str().c_str());
141  if (res) {
142  LOG(WARN, "/usr/bin/contrail-rndc command failed");
143  }
144  } else {
145  std::stringstream str;
146  // execute the helper script to apply named config
147  str << "python3 /etc/contrail/dns/applynamedconfig.py";
148  int res = system(str.str().c_str());
149  if (res) {
150  LOG(ERROR, "Applying named configuration failed");
151  }
152  }
153 }
154 
156  GetDefaultForwarders();
157  file_.open(named_config_file_.c_str());
158 
159  WriteOptionsConfig();
160  WriteRndcConfig();
161  WriteLoggingConfig();
162  WriteViewConfig(updated_vdns);
163 
164  file_.flush();
165  file_.close();
166 }
167 
169  file_.open(rndc_config_file_.c_str());
170 
171  file_ << "key \"rndc-key\" {" << endl;
172  file_ << " algorithm hmac-md5;" << endl;
173  file_ << " secret \"" << rndc_secret_ << "\";" << endl;
174  file_ << "};" << endl << endl;
175 
176  file_ << "options {" << endl;
177  file_ << " default-key \"rndc-key\";" << endl;
178  file_ << " default-server 127.0.0.1;" << endl;
179  file_ << " default-port " << ContrailPorts::DnsRndc() << ";" << endl;
180  file_ << "};" << endl << endl;
181 
182  file_.flush();
183  file_.close();
184 }
185 
187  file_ << "options {" << endl;
188  file_ << " directory \"" << named_config_dir_ << "\";" << endl;
189  file_ << " managed-keys-directory \"" << named_config_dir_ << "\";" << endl;
190  file_ << " empty-zones-enable no;" << endl;
191  file_ << " pid-file \"" << GetPidFilePath() << "\";" << endl;
192  file_ << " session-keyfile \"" << GetSessionKeyFilePath() << "\";" << endl;
193  file_ << " listen-on port " << Dns::GetDnsPort() << " { any; };" << endl;
194  file_ << " allow-query { any; };" << endl;
195  file_ << " allow-recursion { any; };" << endl;
196  file_ << " allow-query-cache { any; };" << endl;
197  if (!named_max_cache_size_.empty())
198  file_ << " max-cache-size " << named_max_cache_size_ << ";" << endl;
199  file_ << "};" << endl << endl;
200 }
201 
203  file_ << "key \"rndc-key\" {" << endl;
204  file_ << " algorithm hmac-md5;" << endl;
205  file_ << " secret \"" << rndc_secret_ << "\";" << endl;
206  file_ << "};" << endl << endl;
207 
208 
209  file_ << "controls {" << endl;
210  file_ << " inet 127.0.0.1 port "<< ContrailPorts::DnsRndc() << endl;
211  file_ << " allow { 127.0.0.1; } keys { \"rndc-key\"; };" << endl;
212  file_ << "};" << endl << endl;
213 }
214 
216  file_ << "logging {" << endl;
217  file_ << " channel debug_log {" << endl;
218  file_ << " file \"" << named_log_file_ << "\" versions 3 size 5m;" << endl;
219  file_ << " severity debug;" << endl;
220  file_ << " print-time yes;" << endl;
221  file_ << " print-severity yes;" << endl;
222  file_ << " print-category yes;" << endl;
223  file_ << " };" << endl;
224  file_ << " category default {" << endl;
225  file_ << " debug_log;" << endl;
226  file_ << " };" << endl;
227  file_ << " category queries {" << endl;
228  file_ << " debug_log;" << endl;
229  file_ << " };" << endl;
230  file_ << "};" << endl << endl;
231 }
232 
234  ZoneViewMap zone_view_map;
235  if (reset_flag_) {
236  WriteDefaultView(zone_view_map);
237  return;
238  }
239 
241  for (VirtualDnsConfig::DataMap::iterator it = vdns.begin(); it != vdns.end(); ++it) {
242  VirtualDnsConfig *curr_vdns = it->second;
243  ZoneList zones;
244  MakeZoneList(curr_vdns, zones);
245 
246  if (curr_vdns->IsDeleted() || !curr_vdns->IsNotified()) {
247  RemoveZoneFiles(curr_vdns, zones);
248  continue;
249  }
250 
251  std::string view_name = curr_vdns->GetViewName();
252  file_ << "view \"" << view_name << "\" {" << endl;
253 
254  std::string order = curr_vdns->GetRecordOrder();
255  if (!order.empty()) {
256  if (order == "round-robin")
257  order = "cyclic";
258  file_ << " rrset-order {order " << order << ";};" << endl;
259  }
260 
261  std::string next_dns = curr_vdns->GetNextDns();
262  if (!next_dns.empty()) {
263  boost::system::error_code ec;
264  boost::asio::ip::address_v4
265  next_addr(boost::asio::ip::address_v4::from_string(next_dns, ec));
266  if (!ec.value()) {
267  file_ << " forwarders {" << next_addr.to_string() << ";};" << endl;
268  } else {
269  file_ << " virtual-forwarder \"" << next_dns << "\";" << endl;
270  }
271  } else if (!default_forwarders_.empty()) {
272  file_ << " forwarders {" << default_forwarders_ << "};" << endl;
273  }
274 
275  bool reverse_resolution = curr_vdns->IsReverseResolutionEnabled();
276  for (unsigned int i = 0; i < zones.size(); i++) {
277  WriteZone(view_name, zones[i], true, reverse_resolution, next_dns);
278  // update the zone view map, to be used to generate default view
279  if (curr_vdns->IsExternalVisible())
280  zone_view_map.insert(ZoneViewPair(zones[i], view_name));
281 
282  }
283 
284  file_ << "};" << endl << endl;
285 
286  if (curr_vdns == updated_vdns || all_zone_files_)
287  AddZoneFiles(zones, curr_vdns);
288  }
289 
290  WriteDefaultView(zone_view_map);
291 }
292 
294  // Create a default view first for any requests which do not have
295  // view name TXT record
296  file_ << "view \"_default_view_\" {" << endl;
297  file_ << " match-clients {any;};" << endl;
298  file_ << " match-destinations {any;};" << endl;
299  file_ << " match-recursive-only no;" << endl;
300  if (!default_forwarders_.empty()) {
301  file_ << " forwarders {" << default_forwarders_ << "};" << endl;
302  }
303  for (ZoneViewMap::iterator it = zone_view_map.begin();
304  it != zone_view_map.end(); ++it) {
305  WriteZone(it->second, it->first, false, false, "");
306  }
307  file_ << "};" << endl << endl;
308 }
309 
310 void NamedConfig::WriteZone(const string &vdns, const string &name,
311  bool is_master, bool is_rr, const string &next_dns) {
312  file_ << " zone \"" << name << "\" IN {" << endl;
313  if (is_master) {
314  file_ << " type master;" << endl;
315  file_ << " file \"" << GetZoneFilePath(vdns, name) << "\";" << endl;
316  file_ << " allow-update {127.0.0.1;};" << endl;
317  if (!next_dns.empty()) {
318  if (!is_rr && BindUtil::IsReverseZone(name)) {
319  file_ << " forwarders { };" << endl;
320  }
321  } else {
322  file_ << " forwarders { };" << endl;
323  }
324  } else {
325  file_ << " type static-stub;" << endl;
326  file_ << " virtual-server-name \"" << vdns << "\";" << endl;
327  file_ << " server-addresses {127.0.0.1;};" << endl;
328  }
329  file_ << " };" << endl;
330 }
331 
333  for (unsigned int i = 0; i < zones.size(); i++) {
334  CreateZoneFile(zones[i], vdns, !BindUtil::IsReverseZone(zones[i]));
335  }
336 }
337 
339  ZoneList &zones) {
340  for (unsigned int i = 0; i < zones.size(); i++) {
341  RemoveZoneFile(vdns, zones[i]);
342  }
343 }
344 
345 void NamedConfig::RemoveZoneFile(const VirtualDnsConfig *vdns, string &zone) {
346  string zfile_name = GetZoneFilePath(vdns->GetViewName(), zone);
347  remove(zfile_name.c_str());
348  zfile_name.append(".jnl");
349  remove(zfile_name.c_str());
350 }
351 
352 string NamedConfig::GetZoneFileName(const string &vdns, const string &name) {
353  if (name.size() && name.at(name.size() - 1) == '.')
354  return (vdns + "." + name + NamedZoneFileSuffix);
355  else
356  return (vdns + "." + name + "." + NamedZoneFileSuffix);
357 }
358 
359 string NamedConfig::GetZoneFilePath(const string &vdns, const string &name) {
360  return (named_config_dir_ + GetZoneFileName(vdns, name));
361 }
362 
364  return (named_config_dir_ + pid_file_name);
365 }
366 
368  return (named_config_dir_ + sessionkey_file_name);
369 }
370 
371 string NamedConfig::GetZoneNSName(const string domain_name) {
372  return (NamedZoneNSPrefix + "." + domain_name);
373 }
374 
375 string NamedConfig::GetZoneMXName(const string domain_name) {
376  return (NamedZoneMXPrefix + "." + domain_name);
377 }
378 
379 void NamedConfig::CreateZoneFile(std::string &zone_name,
380  const VirtualDnsConfig *vdns, bool ns) {
381  ofstream zfile;
382  string ns_name;
383  string zone_filename = GetZoneFilePath(vdns->GetViewName(), zone_name);
384 
385  zfile.open(zone_filename.c_str());
386  zfile << "$ORIGIN ." << endl;
387  if (vdns->GetTtl() > 0) {
388  zfile << "$TTL " << vdns->GetTtl() << endl;
389  } else {
390  zfile << "$TTL " << Defaults::GlobalTTL << endl;
391  }
392  zfile << left << setw(NameWidth) << zone_name << " IN SOA " <<
393  GetZoneNSName(vdns->GetDomainName()) << " " <<
394  GetZoneMXName(vdns->GetDomainName()) << " (" << endl;
395  zfile << setw(NameWidth + 8) << "" << setw(NumberWidth) << Defaults::Serial << endl;
396  zfile << setw(NameWidth + 8) << "" << setw(NumberWidth) << Defaults::Refresh << endl;
397  zfile << setw(NameWidth + 8) << "" << setw(NumberWidth) << Defaults::Retry << endl;
398  zfile << setw(NameWidth + 8) << "" << setw(NumberWidth) << Defaults::Expire << endl;
399  if (vdns->GetNegativeCacheTtl() > 0 ) {
400  zfile << setw(NameWidth + 8) << "" << setw(NumberWidth) << vdns->GetNegativeCacheTtl() << endl;
401  } else {
402  zfile << setw(NameWidth + 8) << "" << setw(NumberWidth) << Defaults::Minimum << endl;
403  }
404  zfile << setw(NameWidth + 8) << "" << ")" << endl;
405  /* NS records are mandatory in zone file. They are required for the following reasons
406  1. Name servers returns NS RR in responses to queries, in the authority section
407  of the DNS message.
408  2. Name servers use the NS records to determine where to send NOTIFY messages.
409  */
410  zfile << setw(NameWidth + 4) << "" << setw(TypeWidth) << " NS " <<
411  setw(NameWidth) << GetZoneNSName(vdns->GetDomainName()) << endl;
412  zfile << "$ORIGIN " << zone_name << endl;
413  //Write the NS record
414  if (ns)
415  zfile << setw(NameWidth) << NamedZoneNSPrefix << " IN A " << Dns::GetSelfIp() << endl;
416  zfile.flush();
417  zfile.close();
418 }
419 
420 // Create a list of zones for the virtual DNS
422  ZoneList &zones) {
423  // always take domain name in lower case, to avoid differences due to case
424  std::string dns_domain = boost::to_lower_copy(vdns_config->GetDomainName());
425  if (dns_domain.empty()) {
426  return;
427  }
428 
429  // Forward Zone
430  zones.push_back(dns_domain);
431 
432  // Reverse zones
433  MakeReverseZoneList(vdns_config, zones);
434 }
435 
437  ZoneList &zones) {
438  const VirtualDnsConfig::IpamList &ipams = vdns_config->GetIpamList();
439  for (VirtualDnsConfig::IpamList::const_iterator ipam_it = ipams.begin();
440  ipam_it != ipams.end(); ++ipam_it) {
441  if ((*ipam_it)->IsDeleted() || !(*ipam_it)->IsValid()) {
442  continue;
443  }
444  const IpamConfig::VnniList &vnni_list = (*ipam_it)->GetVnniList();
445  for (IpamConfig::VnniList::iterator vnni_it = vnni_list.begin();
446  vnni_it != vnni_list.end(); ++vnni_it) {
447  if ((*vnni_it)->IsDeleted() || !(*vnni_it)->IsValid()) {
448  continue;
449  }
450  const Subnets &subnets = (*vnni_it)->GetSubnets();
451  for (unsigned int i = 0; i < subnets.size(); ++i) {
452  const Subnet &subnet = subnets[i];
453  if (subnet.IsDeleted())
454  continue;
455  subnet.GetReverseZones(zones);
456  }
457  }
458  }
459 
460  // If same subnet is used in different VNs, remove duplicates
461  std::sort(zones.begin(), zones.end());
462  ZoneList::iterator it = std::unique(zones.begin(), zones.end());
463  zones.resize(std::distance(zones.begin(), it));
464 }
465 
467  default_forwarders_.clear();
468  std::ifstream fd;
469  fd.open(GetResolveFile().c_str());
470  if (!fd.is_open()) {
471  return;
472  }
473 
474  std::string line;
475  while (getline(fd, line)) {
476  std::size_t pos = line.find_first_of("#");
477  std::stringstream ss(line.substr(0, pos));
478  std::string key;
479  ss >> key;
480  if (key == "nameserver") {
481  std::string ip;
482  ss >> ip;
483  boost::system::error_code ec;
484  boost::asio::ip::address_v4::from_string(ip, ec);
485  if (!ec.value()) {
486  default_forwarders_ += ip + "; ";
487  }
488  }
489  }
490 
491  fd.close();
492 }
493 
495 
497  : named_pid_(-1), handler_(handler), change_timeout_(true) {
499  *Dns::GetEventManager()->io_service(), "BindStatusTimer",
500  TaskScheduler::GetInstance()->GetTaskId("dns::BindStatus"), 0);
502  boost::bind(&BindStatus::CheckBindStatus, this));
503 }
504 
508 }
509 
510 // Check if a given pid belongs to contrail-named
511 bool BindStatus::IsBindPid(uint32_t pid) {
512  bool ret = false;
513  std::stringstream str;
514  str << "/proc/" << pid << "/cmdline";
515 
516  ifstream ifile(str.str().c_str());
517  if (ifile.is_open()) {
518  if (ifile.good()) {
519  std::string cmdline;
520  cmdline.assign((istreambuf_iterator<char>(ifile)),
521  istreambuf_iterator<char>());
522  istringstream cmdstream(cmdline);
523  if (cmdstream.str().find("/usr/bin/contrail-named") !=
524  std::string::npos) {
525  ret = true;
526  }
527  }
528  ifile.close();
529  }
530 
531  return ret;
532 }
533 
535  uint32_t new_pid = -1;
537  if (ncfg) {
538  std::ifstream pid_file(ncfg->GetPidFilePath().c_str());
539  if (pid_file.is_open()) {
540  if (pid_file.good()) {
541  pid_file >> new_pid;
542  }
543  pid_file.close();
544  }
545  }
546 
547  if (new_pid == (uint32_t) -1) {
548  handler_(Down);
549  } else if (!IsBindPid(new_pid)) {
550  if (named_pid_ != (uint32_t) -1) {
551  named_pid_ = -1;
552  handler_(Down);
553  }
554  } else {
555  if (named_pid_ != new_pid) {
556  named_pid_ = new_pid;
557  handler_(Up);
558  }
559  }
560 
561  if (change_timeout_) {
562  change_timeout_ = false;
564  }
565  return true;
566 }
void RemoveZoneFiles(const VirtualDnsConfig *vdns, ZoneList &zones)
static const char pid_file_name[]
Definition: named_config.h:53
virtual void AddAllViews()
Definition: named_config.cc:84
std::string GetZoneNSName(const std::string domain_name)
virtual void DelZone(const Subnet &subnet, const VirtualDnsConfig *vdns)
int GetNegativeCacheTtl() const
Definition: dns_oper.h:182
void CreateZoneFile(std::string &zone_name, const VirtualDnsConfig *vdns, bool ns)
Timer * status_timer_
Definition: named_config.h:38
std::pair< std::string, std::string > ZoneViewPair
Definition: named_config.h:48
const IpamList & GetIpamList() const
Definition: dns_oper.h:159
static const uint32_t GetDnsPort()
Definition: dns.h:61
virtual void ChangeView(const VirtualDnsConfig *vdns)
Definition: named_config.cc:70
void WriteZone(const std::string &vdns, const std::string &name, bool is_master, bool is_rr, const std::string &next_dns)
virtual void AddView(const VirtualDnsConfig *vdns)
Definition: named_config.cc:66
static const uint32_t kBindStatusTimeout
Definition: named_config.h:16
std::string GetOldDomainName() const
Definition: dns_oper.h:173
void GetDefaultForwarders()
bool IsBindPid(uint32_t pid)
std::string GetZoneMXName(const std::string domain_name)
static void Init(const std::string &named_config_dir, const std::string &named_config_file, const std::string &named_log_file, const std::string &rndc_config_file, const std::string &rndc_secret, const std::string &named_max_cache_size)
Definition: named_config.cc:28
virtual void AddZone(const Subnet &subnet, const VirtualDnsConfig *vdns)
Definition: named_config.cc:90
std::string GetPidFilePath()
void MakeZoneList(const VirtualDnsConfig *vdns_config, ZoneList &zones)
static const char sessionkey_file_name[]
Definition: named_config.h:54
std::set< VnniConfig * > VnniList
Definition: dns_oper.h:101
bool change_timeout_
Definition: named_config.h:39
static std::string GetSelfIp()
Definition: dns.h:63
bool IsReverseResolutionEnabled() const
Definition: dns_oper.h:176
void WriteRndcConfig()
void CreateRndcConf()
void GetReverseZones(ZoneList &zones) const
Definition: bind_util.cc:108
uint32_t named_pid_
Definition: named_config.h:36
static void Shutdown()
Definition: named_config.cc:41
void CreateNamedConf(const VirtualDnsConfig *updated_vdns)
static NamedConfig * GetNamedConfigObject()
Definition: named_config.h:83
static bool IsReverseZone(const std::string &name)
Definition: bind_util.cc:711
virtual std::string GetZoneFilePath(const std::string &vdns, const std::string &name)
std::string GetSessionKeyFilePath()
int GetTtl() const
Definition: dns_oper.h:181
std::string GetRecordOrder() const
Definition: dns_oper.h:174
void WriteDefaultView(ZoneViewMap &zone_view_map)
bool IsExternalVisible() const
Definition: dns_oper.h:175
static TaskScheduler * GetInstance()
Definition: task.cc:547
bool IsDeleted() const
Definition: bind_util.h:270
virtual ~BindStatus()
static const std::string NamedZoneNSPrefix
Definition: named_config.h:51
std::vector< Subnet > Subnets
Definition: bind_util.h:278
virtual void DelView(const VirtualDnsConfig *vdns)
Definition: named_config.cc:80
std::string GetDomainName() const
Definition: dns_oper.h:172
void Reset()
Definition: named_config.cc:47
bool IsNotified() const
Definition: dns_oper.h:48
static Timer * CreateTimer(boost::asio::io_context &service, const std::string &name, int task_id=Timer::GetTimerTaskId(), int task_instance=Timer::GetTimerInstanceId(), bool delete_on_completion=false)
Definition: timer.cc:201
virtual void UpdateNamedConf(const VirtualDnsConfig *updated_vdns=NULL)
std::map< std::string, std::string > ZoneViewMap
Definition: named_config.h:47
std::string GetViewName() const
Definition: dns_oper.cc:454
bool Cancel()
Definition: timer.cc:150
void AddZoneFiles(ZoneList &zones, const VirtualDnsConfig *vdns)
static const uint16_t DnsRndc()
void WriteViewConfig(const VirtualDnsConfig *updated_vdns)
static const std::string NamedZoneMXPrefix
Definition: named_config.h:52
void RemoveZoneFile(const VirtualDnsConfig *vdns, std::string &zone)
bool Start(int time, Handler handler, ErrorHandler error_handler=NULL)
Definition: timer.cc:108
bool CheckBindStatus()
std::map< std::string, VirtualDnsConfig * > DataMap
Definition: dns_oper.h:139
BindEventHandler handler_
Definition: named_config.h:37
#define LOG(_Level, _Msg)
Definition: logging.h:33
std::string GetNextDns() const
Definition: dns_oper.cc:460
static NamedConfig * singleton_
Definition: named_config.h:146
static EventManager * GetEventManager()
Definition: dns.h:31
bool Reschedule(int time)
Definition: timer.cc:137
static const std::string NamedZoneFileSuffix
Definition: named_config.h:50
std::set< IpamConfig * > IpamList
Definition: dns_oper.h:137
BindStatus(BindEventHandler handler)
bool IsDeleted() const
Definition: dns_oper.h:51
void WriteLoggingConfig()
virtual std::string GetZoneFileName(const std::string &vdns, const std::string &name)
static DataMap & GetVirtualDnsMap()
Definition: dns_oper.h:185
static const uint32_t kInitTimeout
Definition: named_config.h:17
boost::function< void(Event)> BindEventHandler
Definition: named_config.h:22
void MakeReverseZoneList(const VirtualDnsConfig *vdns_config, ZoneList &zones)
void WriteOptionsConfig()
std::vector< std::string > ZoneList
Definition: bind_util.h:250
static bool DeleteTimer(Timer *Timer)
Definition: timer.cc:222