Browse Source

Remove unused, old code. (Makefile had it commented out and
okayed by each@.)


git-svn-id: svn://bind10.isc.org/svn/bind10/trunk@966 e5f2f494-b856-4b98-b285-d166d9295462

Jeremy C. Reed 15 years ago
parent
commit
90750f86ab

+ 0 - 1
src/lib/auth/cpp/Makefile.am

@@ -5,5 +5,4 @@ CLEANFILES = *.gcno *.gcda
 lib_LTLIBRARIES = libauth.la
 libauth_la_SOURCES = data_source.h data_source.cc
 libauth_la_SOURCES += data_source_static.h data_source_static.cc
-#libauth_la_SOURCES += data_source_plot.h data_source_plot.cc
 libauth_la_SOURCES += query.h query.cc

+ 0 - 187
src/lib/auth/cpp/data_source_plot.cc

@@ -1,187 +0,0 @@
-
-#include <boost/foreach.hpp>
-
-#include <dns/rrttl.h>
-
-#include "data_source_plot.h"
-
-namespace isc {
-namespace dns {
-
-// this implementation returns fixed records,
-// and does not allow update statements
-
-using namespace isc::dns;
-using namespace isc::dns::rdata;
-using namespace isc::data;
-
-namespace {
-const Name authors_name("authors.bind");
-const Name version_name("version.bind");
-}
-
-void
-DataSourceParkingLot::serve(std::string zone_name) {
-    zones.serve(zone_name);
-}
-
-void
-DataSourceParkingLot::addARecord(std::string data) {
-    a_records.push_back(RdataPtr(new in::A(data)));
-}
-
-void
-DataSourceParkingLot::addAAAARecord(std::string data) {
-    aaaa_records.push_back(RdataPtr(new in::AAAA(data)));
-}
-
-void
-DataSourceParkingLot::addNSRecord(std::string data) {
-    ns_records.push_back(RdataPtr(new generic::NS(data)));
-}
-
-void
-DataSourceParkingLot::setSOARecord(RdataPtr soa_record) {
-}
-
-void
-DataSourceParkingLot::setDefaultZoneData() {
-    clearARecords();
-    clearAAAARecords();
-    clearNSRecords();
-
-    addARecord("127.0.0.1");
-    addAAAARecord("::1");
-    addNSRecord("ns1.parking.example");
-    addNSRecord("ns2.parking.example");
-    addNSRecord("ns3.parking.example");
-}
-
-DataSourceParkingLot::DataSourceParkingLot() {
-    setDefaultZoneData();
-    soa = RdataPtr(new generic::SOA(Name("parking.example"),
-                                    Name("noc.parking.example"),
-                                    1, 1800, 900, 604800, 86400));
-}
-
-bool
-DataSourceParkingLot::hasZoneFor(const Name& name, Name &zone_name)
-{
-    if (name == authors_name) {
-        zone_name = authors_name;
-        return (true);
-    } else if (name == version_name) {
-        zone_name = version_name;
-        return (true);
-    }
-    return zones.findClosest(name, zone_name);
-}
-
-SearchResult
-DataSourceParkingLot::findRRsets(const isc::dns::Name& zone_name,
-                                 const isc::dns::Name& name,
-                                 const isc::dns::RRClass& clas,
-                                 const isc::dns::RRType& type) const
-{
-    SearchResult result;
-    
-    if (clas == RRClass::CH()) {
-        if (type == RRType::TXT()) {
-            if (name == authors_name) {
-                RRsetPtr rrset = RRsetPtr(new RRset(authors_name, RRClass::CH(),
-                                                    RRType::TXT(), RRTTL(0)));
-                rrset->addRdata(generic::TXT("Han Feng"));
-                rrset->addRdata(generic::TXT("Kazunori Fujiwara"));
-                rrset->addRdata(generic::TXT("Michael Graff"));
-                rrset->addRdata(generic::TXT("Evan Hunt"));
-                rrset->addRdata(generic::TXT("Jelte Jansen"));
-                rrset->addRdata(generic::TXT("Jin Jian"));
-                rrset->addRdata(generic::TXT("JINMEI Tatuya"));
-                rrset->addRdata(generic::TXT("Naoki Kambe"));
-                rrset->addRdata(generic::TXT("Shane Kerr")); 
-                rrset->addRdata(generic::TXT("Zhang Likun"));
-                rrset->addRdata(generic::TXT("Jeremy C. Reed")); 
-
-                result.addRRset(rrset);
-                result.setStatus(SearchResult::success);
-            } else if (name == version_name) {
-                RRsetPtr rrset = RRsetPtr(new RRset(version_name, RRClass::CH(),
-                                                    RRType::TXT(), RRTTL(0)));
-                rrset->addRdata(generic::TXT("BIND10 0.0.1"));
-                result.addRRset(rrset);
-                result.setStatus(SearchResult::success);
-            } else {
-                result.setStatus(SearchResult::name_not_found);
-            }
-        } else if (type == RRType::NS()) {
-            if (name == authors_name || name == version_name) {
-                RRsetPtr rrset = RRsetPtr(new RRset(name, RRClass::CH(),
-                                                    RRType::NS(),
-                                                    RRTTL(0)));
-                rrset->addRdata(generic::NS(name));
-                result.addRRset(rrset);
-                result.setStatus(SearchResult::success);
-            } else {
-                result.setStatus(SearchResult::name_not_found);
-            }
-        } else {
-            result.setStatus(SearchResult::name_not_found);
-        }
-    } else if (clas == RRClass::IN()) {
-        if (zones.contains(name)) {
-            RRsetPtr rrset = RRsetPtr(new RRset(name, clas, type, RRTTL(3600)));
-            result.setStatus(SearchResult::success);
-            if (type == RRType::A()) {
-                BOOST_FOREACH(RdataPtr a, a_records) {
-                    rrset->addRdata(a);
-                }
-            } else if (type == RRType::AAAA()) {
-                BOOST_FOREACH(RdataPtr aaaa, aaaa_records) {
-                    rrset->addRdata(aaaa);
-                }
-            } else if (type == RRType::NS()) {
-                BOOST_FOREACH(RdataPtr ns, ns_records) {
-                    rrset->addRdata(ns);
-                }
-            } else if (type == RRType::SOA()) {
-                rrset->addRdata(soa);
-            }
-            result.addRRset(rrset);
-        } else {
-            // we don't have the name itself. Do we have the zone?
-            if (zones.contains(zone_name)) {
-                result.setStatus(SearchResult::name_not_found);
-            } else {
-                result.setStatus(SearchResult::zone_not_found);
-            }
-        }
-    } else {
-        result.setStatus(SearchResult::zone_not_found);
-    }
-    return result;
-}
-
-/// Do direct 'search' in database, no extra processing,
-/// and add the resulting rrsets to the specified section
-/// in the given message
-/// returns the status code of the searchresult
-/// Once the dns logic is moved from parkinglot to this class,
-/// we should probably make this private
-SearchResult::status_type
-DataSourceParkingLot::addToMessage(Message& msg,
-             const Section& section,
-             const Name& zone_name,
-             const Name& name,
-             const RRClass& clas,
-             const RRType& type) const
-{
-    SearchResult result = findRRsets(zone_name, name, clas, type);
-    BOOST_FOREACH(RRsetPtr rrset, result) {
-        msg.addRRset(section, rrset);
-    }
-    return result.getStatus();
-}
-
-
-}
-}

+ 0 - 96
src/lib/auth/cpp/data_source_plot.h

@@ -1,96 +0,0 @@
-
-// Copyright (C) 2009  Internet Systems Consortium, Inc. ("ISC")
-//
-// Permission to use, copy, modify, and/or distribute this software for any
-// purpose with or without fee is hereby granted, provided that the above
-// copyright notice and this permission notice appear in all copies.
-//
-// THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
-// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
-// AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
-// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
-// LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
-// OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
-// PERFORMANCE OF THIS SOFTWARE.
-
-// $Id$
-
-#ifndef __DATA_SOURCE_SIMPLE_H
-#define __DATA_SOURCE_SIMPLE_H
-
-#include <dns/buffer.h>
-#include <dns/name.h>
-#include <dns/rdata.h>
-#include <dns/rrclass.h>
-#include <dns/rrtype.h>
-#include <dns/rrset.h>
-#include <dns/message.h>
-
-#include <cc/data.h>
-
-#include "common.h"
-
-#include "data_source.h"
-
-#include "zoneset.h"
-
-namespace isc {
-namespace dns {
-
-class DataSourceParkingLot : public DataSource {
-public:
-    DataSourceParkingLot();
-    
-    void init() {};
-    void close() {};
-    bool hasZoneFor(const Name& name, Name &zone_name);
-    SearchResult findRRsets(const isc::dns::Name& zone_name,
-                            const isc::dns::Name& name,
-                            const isc::dns::RRClass& clas,
-                            const isc::dns::RRType& type) const;
-
-    /* move these to private (or to zoneset) and the calling functions
-     * from parkinglot to here? */
-    void serve(std::string zone_name);
-    void clear_zones() { zones.clear_zones(); };
-
-    void clearARecords() { a_records.clear(); };
-    void clearAAAARecords() { aaaa_records.clear(); };
-    void clearNSRecords() { ns_records.clear(); };
-
-    void addARecord(std::string data);
-    void addAAAARecord(std::string data);
-    void addNSRecord(std::string data);
-
-    void setSOARecord(isc::dns::rdata::RdataPtr soa_record);
-
-    /// Do direct 'search' in database, no extra processing,
-    /// and add the resulting rrsets to the specified section
-    /// in the given message
-    /// Once the dns logic is moved from parkinglot to this class,
-    /// we should probably make this private
-    SearchResult::status_type addToMessage(Message& msg,
-                                           const isc::dns::Section& section,
-                                           const isc::dns::Name& zone_name,
-                                           const isc::dns::Name& name,
-                                           const isc::dns::RRClass& clas,
-                                           const isc::dns::RRType& type) const;
-
-private:
-    //
-    void setDefaultZoneData();
-
-    std::vector<isc::dns::rdata::RdataPtr> a_records, aaaa_records, ns_records;
-    isc::dns::rdata::RdataPtr soa;
-    ZoneSet zones;
-
-};
-
-}
-}
-
-#endif
-
-// Local Variables: 
-// mode: c++
-// End: