Main Page | Class Hierarchy | Class List | Directories | File List | Class Members

DnsBind.h

00001 /* -*- Mode: C++; c-file-style: "stroustrup"; indent-tabs-mode: nil -*- */
00002 /*
00003  * DnsBind.h
00004  *   Implement the BIND nameserver driver.
00005  *
00006  * $Id: DnsBind.h,v 1.6 2003/04/24 04:44:56 benoit Exp $
00007  *
00008  * Copyright (c) 2000-2001 Remi Lefebvre <remi@dhis.net>
00009  *
00010  * DDT comes with ABSOLUTELY NO WARRANTY and is licenced under the
00011  * GNU General Public License (version 2 or later). This license
00012  * can be retrieved from http://www.gnu.org/copyleft/gnu.html.
00013  *
00014  */
00015 
00016 #ifndef DNSBIND_H
00017 #define DNSBIND_H
00018 
00019 #ifdef HAVE_CONFIG_H
00020 #include "config.h"
00021 #endif
00022 
00023 #include <string>
00024 #include <stdlib.h>
00025 #include <netinet/in.h>
00026 
00027 #undef __P
00028 #define __P(args) args
00029 
00030 extern "C" {
00031 #include <res_update.h>
00032 }
00033 
00034 /* we need to redefine this because ISC apparently doesn't care for C++ */
00035 #undef INIT_LINK
00036 #define INIT_LINK(elt, link) \
00037     do { \
00038         (elt)->link.prev = NULL; \
00039         (elt)->link.next = NULL; \
00040     } while (0)
00041 
00042 
00043 #include "Logger.h"
00044 #include "Exception.h"
00045 #include "Db.h"
00046 #include "Dns.h"
00047 #include "global.h"
00048 
00053 class DnsBind : public Dns
00054 {
00055   public:
00057     DnsBind(Logger *log);
00058 
00060     ~DnsBind();
00061 
00062     void addDnsRecord(int id, const char *dname, DnsRecordType type,
00063                       const char *data);
00064 
00065     void delDnsRecords(char *dname);
00066 
00067     void delDnsRecord(int id, const char *dname, DnsRecordType type,
00068                       const char *data);
00069     
00070     void updateDnsRecord(int id, const char *dname, DnsRecordType type,
00071                          const char *data);
00072 
00073   private:
00075     int updateRecord(ns_sect r_section, const char *dname, const char *data, 
00076                      int r_opcode, ns_type r_type);
00077 
00079     int flush();
00080 
00081   protected:
00083     DnsBind() { };
00084 
00085   private:
00086     res_state statp;
00087     ns_updque listupdrec;
00088     ns_updrec *rrecp_in;
00089     Logger *log;
00090 };
00091 
00092 #endif // DNSBIND_H

Generated on Tue Sep 13 01:32:47 2005 for DDT Project by  doxygen 1.4.4