"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "modules/randombackend/randombackend.cc" between
pdns-auth-4.1.13.tar.gz and pdns-auth-4.2.0.tar.gz

About: PowerDNS Authoritative Nameserver is a versatile nameserver which supports a large number of backends (that can either be plain zone files or be more dynamic in nature).

randombackend.cc  (pdns-auth-4.1.13):randombackend.cc  (pdns-auth-4.2.0)
skipping to change at line 25 skipping to change at line 25
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/ */
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
#include "config.h" #include "config.h"
#endif #endif
#include "pdns/utility.hh"
#include "pdns/dnsbackend.hh" #include "pdns/dnsbackend.hh"
#include "pdns/dns.hh" #include "pdns/dns.hh"
#include "pdns/dnsbackend.hh" #include "pdns/dnsbackend.hh"
#include "pdns/dnspacket.hh" #include "pdns/dnspacket.hh"
#include "pdns/dns_random.hh"
#include "pdns/pdnsexception.hh" #include "pdns/pdnsexception.hh"
#include "pdns/logger.hh" #include "pdns/logger.hh"
#include "pdns/version.hh" #include "pdns/version.hh"
#include <boost/algorithm/string.hpp> #include <boost/algorithm/string.hpp>
/* FIRST PART */ /* FIRST PART */
class RandomBackend : public DNSBackend class RandomBackend : public DNSBackend
{ {
public: public:
RandomBackend(const string &suffix="") RandomBackend(const string &suffix="")
skipping to change at line 62 skipping to change at line 62
{ {
if(qdomain == d_ourdomain){ if(qdomain == d_ourdomain){
if(type.getCode() == QType::SOA || type.getCode() == QType::ANY) { if(type.getCode() == QType::SOA || type.getCode() == QType::ANY) {
d_answer="ns1." + d_ourdomain.toString() + " hostmaster." + d_ourdomain. toString() + " 1234567890 86400 7200 604800 300"; d_answer="ns1." + d_ourdomain.toString() + " hostmaster." + d_ourdomain. toString() + " 1234567890 86400 7200 604800 300";
} else { } else {
d_answer.clear();; d_answer.clear();;
} }
} else if (qdomain == d_ourname) { } else if (qdomain == d_ourname) {
if(type.getCode() == QType::A || type.getCode() == QType::ANY) { if(type.getCode() == QType::A || type.getCode() == QType::ANY) {
ostringstream os; ostringstream os;
os<<Utility::random()%256<<"."<<Utility::random()%256<<"."<<Utility::ran dom()%256<<"."<<Utility::random()%256; os<<dns_random(256)<<"."<<dns_random(256)<<"."<<dns_random(256)<<"."<<dn s_random(256);
d_answer=os.str(); // our random ip address d_answer=os.str(); // our random ip address
} else { } else {
d_answer=""; d_answer="";
} }
} else { } else {
d_answer=""; d_answer="";
} }
} }
bool get(DNSResourceRecord &rr) override bool get(DNSResourceRecord &rr) override
skipping to change at line 123 skipping to change at line 123
}; };
/* THIRD PART */ /* THIRD PART */
class RandomLoader class RandomLoader
{ {
public: public:
RandomLoader() RandomLoader()
{ {
BackendMakers().report(new RandomFactory); BackendMakers().report(new RandomFactory);
L << Logger::Info << "[randombackend] This is the random backend version " V ERSION g_log << Logger::Info << "[randombackend] This is the random backend version " VERSION
#ifndef REPRODUCIBLE #ifndef REPRODUCIBLE
<< " (" __DATE__ " " __TIME__ ")" << " (" __DATE__ " " __TIME__ ")"
#endif #endif
<< " reporting" << endl; << " reporting" << endl;
} }
}; };
static RandomLoader randomLoader; static RandomLoader randomLoader;
 End of changes. 4 change blocks. 
3 lines changed or deleted 3 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)