[svn] commit: r3674 - in /branches/trac412: ./ src/bin/bind10/ src/bin/host/ src/bin/stats/tests/isc/util/ src/lib/datasrc/ src/lib/datasrc/tests/ src/lib/dns/ src/lib/dns/python/ src/lib/dns/python/tests/ src/lib/dns/rdata/any_255/ src/lib/dns/tests/ src/lib/dns/tests/testdata/ src/lib/python/isc/datasrc/ src/lib/python/isc/datasrc/tests/ src/lib/python/isc/util/ src/lib/python/isc/utils/
BIND 10 source code commits
bind10-changes at lists.isc.org
Tue Nov 30 13:20:42 UTC 2010
Author: stephen
Date: Tue Nov 30 13:20:42 2010
New Revision: 3674
Log:
After synchronizing with trunk r3667
Added:
branches/trac412/src/lib/datasrc/tests/zonetable_unittest.cc
- copied unchanged from r3669, trunk/src/lib/datasrc/tests/zonetable_unittest.cc
branches/trac412/src/lib/datasrc/zonetable.cc
- copied unchanged from r3669, trunk/src/lib/datasrc/zonetable.cc
branches/trac412/src/lib/datasrc/zonetable.h
- copied unchanged from r3669, trunk/src/lib/datasrc/zonetable.h
branches/trac412/src/lib/dns/python/tests/tsigkey_python_test.py
- copied unchanged from r3669, trunk/src/lib/dns/python/tests/tsigkey_python_test.py
branches/trac412/src/lib/dns/python/tsigkey_python.cc
- copied unchanged from r3669, trunk/src/lib/dns/python/tsigkey_python.cc
branches/trac412/src/lib/dns/rdata/any_255/
- copied from r3669, trunk/src/lib/dns/rdata/any_255/
branches/trac412/src/lib/dns/tests/rdata_tsig_unittest.cc
- copied unchanged from r3669, trunk/src/lib/dns/tests/rdata_tsig_unittest.cc
branches/trac412/src/lib/dns/tests/testdata/rdata_tsig_fromWire1.spec
- copied unchanged from r3669, trunk/src/lib/dns/tests/testdata/rdata_tsig_fromWire1.spec
branches/trac412/src/lib/dns/tests/testdata/rdata_tsig_fromWire2.spec
- copied unchanged from r3669, trunk/src/lib/dns/tests/testdata/rdata_tsig_fromWire2.spec
branches/trac412/src/lib/dns/tests/testdata/rdata_tsig_fromWire3.spec
- copied unchanged from r3669, trunk/src/lib/dns/tests/testdata/rdata_tsig_fromWire3.spec
branches/trac412/src/lib/dns/tests/testdata/rdata_tsig_fromWire4.spec
- copied unchanged from r3669, trunk/src/lib/dns/tests/testdata/rdata_tsig_fromWire4.spec
branches/trac412/src/lib/dns/tests/testdata/rdata_tsig_fromWire5.spec
- copied unchanged from r3669, trunk/src/lib/dns/tests/testdata/rdata_tsig_fromWire5.spec
branches/trac412/src/lib/dns/tests/testdata/rdata_tsig_fromWire6.spec
- copied unchanged from r3669, trunk/src/lib/dns/tests/testdata/rdata_tsig_fromWire6.spec
branches/trac412/src/lib/dns/tests/testdata/rdata_tsig_fromWire7.spec
- copied unchanged from r3669, trunk/src/lib/dns/tests/testdata/rdata_tsig_fromWire7.spec
branches/trac412/src/lib/dns/tests/testdata/rdata_tsig_fromWire8.spec
- copied unchanged from r3669, trunk/src/lib/dns/tests/testdata/rdata_tsig_fromWire8.spec
branches/trac412/src/lib/dns/tests/testdata/rdata_tsig_fromWire9.spec
- copied unchanged from r3669, trunk/src/lib/dns/tests/testdata/rdata_tsig_fromWire9.spec
branches/trac412/src/lib/dns/tests/testdata/rdata_tsig_toWire1.spec
- copied unchanged from r3669, trunk/src/lib/dns/tests/testdata/rdata_tsig_toWire1.spec
branches/trac412/src/lib/dns/tests/testdata/rdata_tsig_toWire2.spec
- copied unchanged from r3669, trunk/src/lib/dns/tests/testdata/rdata_tsig_toWire2.spec
branches/trac412/src/lib/dns/tests/testdata/rdata_tsig_toWire3.spec
- copied unchanged from r3669, trunk/src/lib/dns/tests/testdata/rdata_tsig_toWire3.spec
branches/trac412/src/lib/dns/tests/testdata/rdata_tsig_toWire4.spec
- copied unchanged from r3669, trunk/src/lib/dns/tests/testdata/rdata_tsig_toWire4.spec
branches/trac412/src/lib/dns/tests/testdata/rdata_tsig_toWire5.spec
- copied unchanged from r3669, trunk/src/lib/dns/tests/testdata/rdata_tsig_toWire5.spec
branches/trac412/src/lib/dns/tests/tsigkey_unittest.cc
- copied unchanged from r3669, trunk/src/lib/dns/tests/tsigkey_unittest.cc
branches/trac412/src/lib/dns/tsigkey.cc
- copied unchanged from r3669, trunk/src/lib/dns/tsigkey.cc
branches/trac412/src/lib/dns/tsigkey.h
- copied unchanged from r3669, trunk/src/lib/dns/tsigkey.h
branches/trac412/src/lib/python/isc/datasrc/tests/
- copied from r3669, trunk/src/lib/python/isc/datasrc/tests/
branches/trac412/src/lib/python/isc/utils/ (props changed)
- copied from r3669, trunk/src/lib/python/isc/utils/
Removed:
branches/trac412/src/lib/dns/tests/tsig_unittest.cc
branches/trac412/src/lib/dns/tsig.cc
branches/trac412/src/lib/dns/tsig.h
Modified:
branches/trac412/ (props changed)
branches/trac412/ChangeLog
branches/trac412/configure.ac
branches/trac412/src/bin/bind10/bind10.py.in (props changed)
branches/trac412/src/bin/host/host.cc
branches/trac412/src/bin/stats/tests/isc/util/ (props changed)
branches/trac412/src/lib/datasrc/Makefile.am
branches/trac412/src/lib/datasrc/data_source.cc
branches/trac412/src/lib/datasrc/tests/Makefile.am
branches/trac412/src/lib/datasrc/tests/datasrc_unittest.cc
branches/trac412/src/lib/datasrc/tests/sqlite3_unittest.cc
branches/trac412/src/lib/datasrc/tests/static_unittest.cc
branches/trac412/src/lib/datasrc/tests/test_datasrc.cc
branches/trac412/src/lib/dns/Makefile.am
branches/trac412/src/lib/dns/python/Makefile.am
branches/trac412/src/lib/dns/python/pydnspp.cc
branches/trac412/src/lib/dns/python/rrset_python.cc
branches/trac412/src/lib/dns/python/tests/Makefile.am
branches/trac412/src/lib/dns/rrclass-placeholder.h
branches/trac412/src/lib/dns/rrset.cc
branches/trac412/src/lib/dns/rrset.h
branches/trac412/src/lib/dns/tests/Makefile.am
branches/trac412/src/lib/dns/tests/message_unittest.cc
branches/trac412/src/lib/dns/tests/rrset_unittest.cc
branches/trac412/src/lib/dns/tests/rrsetlist_unittest.cc
branches/trac412/src/lib/dns/tests/testdata/Makefile.am
branches/trac412/src/lib/dns/tests/testdata/gen-wiredata.py.in
branches/trac412/src/lib/python/isc/datasrc/Makefile.am
branches/trac412/src/lib/python/isc/datasrc/master.py
branches/trac412/src/lib/python/isc/util/ (props changed)
Modified: branches/trac412/ChangeLog
==============================================================================
--- branches/trac412/ChangeLog (original)
+++ branches/trac412/ChangeLog Tue Nov 30 13:20:42 2010
@@ -1,3 +1,34 @@
+ 121. [func] jinmei
+ src/lib/dns: Added support for TSIG RDATA. At this moment this is
+ not much of real use, however, because no protocol support was
+ added yet. It will soon be added. (Trac #372, svn r3649)
+
+ 120. [func] jinmei
+ src/lib/dns: introduced two new classes, TSIGKey and TSIGKeyRing,
+ to manage TSIG keys. (Trac #381, svn r3622)
+
+ 119. [bug] jinmei
+ The master file parser of the python datasrc module incorrectly
+ regarded a domain name beginning with a decimal number as a TTL
+ specification. This confused b10-loadzone and had it reject to
+ load a zone file that contains such a name.
+ Note: this fix is incomplete and the loadzone would still be
+ confused if the owner name is a syntactically indistinguishable
+ from a TTL specification. This is part of a more general issue
+ and will be addressed in Trac #413. (Trac #411, svn r3599)
+
+ 118. [func] jinmei
+ src/lib/dns: changed the interface of AbstractRRset::getRdataIterator()
+ so that the internal cursor would point to the first RDATA
+ automatically. This will be a more intuitive and less error prone
+ behavior. This is a backward compatible change. (Trac #410, r3595)
+
+ 117. [func] jinmei
+ src/lib/datasrc: added new zone and zone table classes for the
+ support of in memory data source. This is an intermediate step to
+ the bigger feature, and is not yet actually usable in practice.
+ (Trac #399, svn r3590)
+
116. [bug] jerry
src/bin/xfrout: Xfrout and Auth will communicate by long tcp
connection, Auth needs to make a new connection only on the first
Modified: branches/trac412/configure.ac
==============================================================================
--- branches/trac412/configure.ac (original)
+++ branches/trac412/configure.ac Tue Nov 30 13:20:42 2010
@@ -494,6 +494,7 @@
src/lib/python/isc/util/Makefile
src/lib/python/isc/util/tests/Makefile
src/lib/python/isc/datasrc/Makefile
+ src/lib/python/isc/datasrc/tests/Makefile
src/lib/python/isc/cc/Makefile
src/lib/python/isc/cc/tests/Makefile
src/lib/python/isc/config/Makefile
Modified: branches/trac412/src/bin/host/host.cc
==============================================================================
--- branches/trac412/src/bin/host/host.cc (original)
+++ branches/trac412/src/bin/host/host.cc Tue Nov 30 13:20:42 2010
@@ -131,7 +131,7 @@
}
RdataIteratorPtr rit = (*it)->getRdataIterator();
- for (rit->first(); !rit->isLast(); rit->next()) {
+ for (; !rit->isLast(); rit->next()) {
// instead of using my name, maybe use returned label?
cout << name << " has address " <<
(*rit).getCurrent().toText() << endl;
Modified: branches/trac412/src/lib/datasrc/Makefile.am
==============================================================================
--- branches/trac412/src/lib/datasrc/Makefile.am (original)
+++ branches/trac412/src/lib/datasrc/Makefile.am Tue Nov 30 13:20:42 2010
@@ -15,3 +15,4 @@
libdatasrc_la_SOURCES += sqlite3_datasrc.h sqlite3_datasrc.cc
libdatasrc_la_SOURCES += query.h query.cc
libdatasrc_la_SOURCES += cache.h cache.cc
+libdatasrc_la_SOURCES += zonetable.h zonetable.cc
Modified: branches/trac412/src/lib/datasrc/data_source.cc
==============================================================================
--- branches/trac412/src/lib/datasrc/data_source.cc (original)
+++ branches/trac412/src/lib/datasrc/data_source.cc Tue Nov 30 13:20:42 2010
@@ -95,7 +95,7 @@
}
RdataIteratorPtr it = rrset->getRdataIterator();
- for (it->first(); !it->isLast(); it->next()) {
+ for (; !it->isLast(); it->next()) {
const Rdata& rd(it->getCurrent());
if (rrset->getType() == RRType::NS()) {
const generic::NS& ns = dynamic_cast<const generic::NS&>(rd);
@@ -123,7 +123,6 @@
// More than one DNAME RR in the RRset is illegal, so we only have
// to process the first one.
- it->first();
if (it->isLast()) {
return;
}
@@ -152,7 +151,6 @@
// More than one CNAME RR in the RRset is illegal, so we only have
// to process the first one.
- it->first();
if (it->isLast()) {
return;
}
@@ -660,7 +658,6 @@
// XXX: currently only one NSEC3 chain per zone is supported;
// we will need to revisit this.
RdataIteratorPtr it = rrset->getRdataIterator();
- it->first();
if (it->isLast()) {
return (ConstNsec3ParamPtr());
}
Modified: branches/trac412/src/lib/datasrc/tests/Makefile.am
==============================================================================
--- branches/trac412/src/lib/datasrc/tests/Makefile.am (original)
+++ branches/trac412/src/lib/datasrc/tests/Makefile.am Tue Nov 30 13:20:42 2010
@@ -24,6 +24,7 @@
run_unittests_SOURCES += query_unittest.cc
run_unittests_SOURCES += cache_unittest.cc
run_unittests_SOURCES += test_datasrc.h test_datasrc.cc
+run_unittests_SOURCES += zonetable_unittest.cc
run_unittests_CPPFLAGS = $(AM_CPPFLAGS) $(GTEST_INCLUDES)
run_unittests_LDFLAGS = $(AM_LDFLAGS) $(GTEST_LDFLAGS)
run_unittests_LDADD = $(GTEST_LDADD)
Modified: branches/trac412/src/lib/datasrc/tests/datasrc_unittest.cc
==============================================================================
--- branches/trac412/src/lib/datasrc/tests/datasrc_unittest.cc (original)
+++ branches/trac412/src/lib/datasrc/tests/datasrc_unittest.cc Tue Nov 30 13:20:42 2010
@@ -124,7 +124,6 @@
EXPECT_EQ(RRClass::IN(), rrset->getClass());
RdataIteratorPtr it = rrset->getRdataIterator();
- it->first();
EXPECT_EQ("192.0.2.1", it->getCurrent().toText());
it->next();
EXPECT_TRUE(it->isLast());
@@ -138,7 +137,6 @@
EXPECT_EQ(RRClass::IN(), rrset->getClass());
it = rrset->getRdataIterator();
- it->first();
EXPECT_EQ("dns01.example.com.", it->getCurrent().toText());
it->next();
EXPECT_EQ("dns02.example.com.", it->getCurrent().toText());
@@ -154,7 +152,6 @@
EXPECT_EQ(RRClass::IN(), rrset->getClass());
it = rrset->getRdataIterator();
- it->first();
EXPECT_EQ("192.0.2.1", it->getCurrent().toText());
it->next();
EXPECT_TRUE(it->isLast());
@@ -193,7 +190,6 @@
EXPECT_EQ(RRClass::IN(), rrset->getClass());
RdataIteratorPtr it = rrset->getRdataIterator();
- it->first();
EXPECT_EQ("dns01.example.com.", it->getCurrent().toText());
it->next();
EXPECT_EQ("dns02.example.com.", it->getCurrent().toText());
@@ -216,7 +212,6 @@
EXPECT_EQ(RRClass::IN(), rrset->getClass());
RdataIteratorPtr it = rrset->getRdataIterator();
- it->first();
EXPECT_EQ("dns01.example.com.", it->getCurrent().toText());
it->next();
EXPECT_EQ("dns02.example.com.", it->getCurrent().toText());
@@ -237,7 +232,6 @@
EXPECT_EQ(RRClass::IN(), rrset->getClass());
it = rrset->getRdataIterator();
- it->first();
EXPECT_EQ("dns01.example.com.", it->getCurrent().toText());
it->next();
EXPECT_EQ("dns02.example.com.", it->getCurrent().toText());
@@ -334,7 +328,6 @@
EXPECT_EQ(RRClass::IN(), rrset->getClass());
RdataIteratorPtr it = rrset->getRdataIterator();
- it->first();
EXPECT_EQ("192.0.2.2", it->getCurrent().toText());
it->next();
EXPECT_TRUE(it->isLast());
@@ -353,7 +346,6 @@
EXPECT_EQ(RRClass::IN(), rrset->getClass());
it = rrset->getRdataIterator();
- it->first();
EXPECT_EQ("dns01.example.com.", it->getCurrent().toText());
it->next();
EXPECT_EQ("dns02.example.com.", it->getCurrent().toText());
@@ -369,7 +361,6 @@
EXPECT_EQ(RRClass::IN(), rrset->getClass());
it = rrset->getRdataIterator();
- it->first();
EXPECT_EQ("192.0.2.1", it->getCurrent().toText());
it->next();
EXPECT_TRUE(it->isLast());
@@ -406,7 +397,6 @@
EXPECT_EQ(RRClass::IN(), rrset->getClass());
RdataIteratorPtr it = rrset->getRdataIterator();
- it->first();
EXPECT_EQ("www.example.com.", it->getCurrent().toText());
it->next();
EXPECT_TRUE(it->isLast());
@@ -419,7 +409,6 @@
EXPECT_EQ(RRClass::IN(), rrset->getClass());
it = rrset->getRdataIterator();
- it->first();
EXPECT_EQ("192.0.2.1", it->getCurrent().toText());
it->next();
EXPECT_TRUE(it->isLast());
@@ -438,7 +427,6 @@
EXPECT_EQ(RRClass::IN(), rrset->getClass());
it = rrset->getRdataIterator();
- it->first();
EXPECT_EQ("dns01.example.com.", it->getCurrent().toText());
it->next();
EXPECT_EQ("dns02.example.com.", it->getCurrent().toText());
@@ -454,7 +442,6 @@
EXPECT_EQ(RRClass::IN(), rrset->getClass());
it = rrset->getRdataIterator();
- it->first();
EXPECT_EQ("192.0.2.1", it->getCurrent().toText());
it->next();
EXPECT_TRUE(it->isLast());
@@ -474,7 +461,6 @@
EXPECT_EQ(RRClass::IN(), rrset->getClass());
RdataIteratorPtr it = rrset->getRdataIterator();
- it->first();
EXPECT_EQ("www.example.com.", it->getCurrent().toText());
it->next();
EXPECT_TRUE(it->isLast());
@@ -506,7 +492,6 @@
EXPECT_EQ(RRClass::IN(), rrset->getClass());
RdataIteratorPtr it = rrset->getRdataIterator();
- it->first();
EXPECT_EQ("spork.example.com.", it->getCurrent().toText());
it->next();
EXPECT_TRUE(it->isLast());
@@ -544,7 +529,6 @@
EXPECT_EQ(RRClass::IN(), rrset->getClass());
RdataIteratorPtr it = rrset->getRdataIterator();
- it->first();
EXPECT_EQ("192.0.2.2", it->getCurrent().toText());
it->next();
EXPECT_TRUE(it->isLast());
@@ -556,7 +540,6 @@
EXPECT_EQ(RRClass::IN(), rrset->getClass());
it = rrset->getRdataIterator();
- it->first();
EXPECT_EQ("dns01.example.com.", it->getCurrent().toText());
it->next();
EXPECT_EQ("dns02.example.com.", it->getCurrent().toText());
@@ -572,7 +555,6 @@
EXPECT_EQ(RRClass::IN(), rrset->getClass());
it = rrset->getRdataIterator();
- it->first();
EXPECT_EQ("192.0.2.1", it->getCurrent().toText());
it->next();
EXPECT_TRUE(it->isLast());
@@ -591,7 +573,6 @@
EXPECT_EQ(RRClass::IN(), rrset->getClass());
RdataIteratorPtr it = rrset->getRdataIterator();
- it->first();
EXPECT_EQ("sql1.example.com.", it->getCurrent().toText());
it->next();
EXPECT_TRUE(it->isLast());
@@ -605,7 +586,6 @@
EXPECT_EQ(RRClass::IN(), rrset->getClass());
it = rrset->getRdataIterator();
- it->first();
EXPECT_EQ("dns01.example.com.", it->getCurrent().toText());
it->next();
EXPECT_EQ("dns02.example.com.", it->getCurrent().toText());
@@ -621,7 +601,6 @@
EXPECT_EQ(RRClass::IN(), rrset->getClass());
it = rrset->getRdataIterator();
- it->first();
EXPECT_EQ("192.0.2.1", it->getCurrent().toText());
it->next();
EXPECT_TRUE(it->isLast());
@@ -649,7 +628,6 @@
EXPECT_EQ(RRClass::IN(), rrset->getClass());
RdataIteratorPtr it = rrset->getRdataIterator();
- it->first();
EXPECT_EQ("cnametest.flame.org.", it->getCurrent().toText());
it->next();
EXPECT_TRUE(it->isLast());
@@ -668,7 +646,6 @@
EXPECT_EQ(RRClass::IN(), rrset->getClass());
RdataIteratorPtr it = rrset->getRdataIterator();
- it->first();
EXPECT_EQ("www.example.com.", it->getCurrent().toText());
it->next();
EXPECT_TRUE(it->isLast());
@@ -695,7 +672,6 @@
EXPECT_EQ(RRClass::IN(), rrset->getClass());
RdataIteratorPtr it = rrset->getRdataIterator();
- it->first();
EXPECT_EQ("www.sql1.example.com.", it->getCurrent().toText());
it->next();
EXPECT_TRUE(it->isLast());
@@ -720,7 +696,6 @@
EXPECT_EQ(RRClass::IN(), rrset->getClass());
RdataIteratorPtr it = rrset->getRdataIterator();
- it->first();
EXPECT_EQ("ns1.subzone.example.com.", it->getCurrent().toText());
it->next();
EXPECT_FALSE(it->isLast());
@@ -732,7 +707,6 @@
EXPECT_EQ(RRClass::IN(), rrset->getClass());
it = rrset->getRdataIterator();
- it->first();
EXPECT_EQ("192.0.2.1", it->getCurrent().toText());
it->next();
EXPECT_TRUE(it->isLast());
@@ -751,7 +725,6 @@
EXPECT_EQ(RRClass::IN(), rrset->getClass());
RdataIteratorPtr it = rrset->getRdataIterator();
- it->first();
EXPECT_EQ("ns1.subzone.example.com.", it->getCurrent().toText());
it->next();
EXPECT_FALSE(it->isLast());
@@ -763,7 +736,6 @@
EXPECT_EQ(RRClass::IN(), rrset->getClass());
it = rrset->getRdataIterator();
- it->first();
EXPECT_EQ("192.0.2.1", it->getCurrent().toText());
it->next();
EXPECT_TRUE(it->isLast());
@@ -795,7 +767,6 @@
EXPECT_EQ(RRClass::IN(), rrset->getClass());
RdataIteratorPtr it = rrset->getRdataIterator();
- it->first();
EXPECT_EQ("dns01.example.com.", it->getCurrent().toText());
it->next();
EXPECT_EQ("dns02.example.com.", it->getCurrent().toText());
@@ -817,7 +788,6 @@
EXPECT_EQ(RRClass::IN(), rrset->getClass());
RdataIteratorPtr it = rrset->getRdataIterator();
- it->first();
EXPECT_EQ("ns1.subzone.example.com.", it->getCurrent().toText());
it->next();
EXPECT_FALSE(it->isLast());
@@ -829,7 +799,6 @@
EXPECT_EQ(RRClass::IN(), rrset->getClass());
it = rrset->getRdataIterator();
- it->first();
EXPECT_EQ("192.0.2.1", it->getCurrent().toText());
it->next();
EXPECT_TRUE(it->isLast());
@@ -854,7 +823,6 @@
EXPECT_EQ(RRClass::IN(), rrset->getClass());
RdataIteratorPtr it = rrset->getRdataIterator();
- it->first();
EXPECT_EQ("dns01.example.com.", it->getCurrent().toText());
it->next();
EXPECT_EQ("dns02.example.com.", it->getCurrent().toText());
@@ -890,7 +858,6 @@
EXPECT_EQ(RRClass::IN(), rrset->getClass());
RdataIteratorPtr it = rrset->getRdataIterator();
- it->first();
EXPECT_EQ(createRdata(RRType::NS(), RRClass::IN(),
"ns.sub.example.org.")->toText(),
it->getCurrent().toText());
@@ -904,7 +871,6 @@
EXPECT_EQ(RRClass::IN(), rrset->getClass());
it = rrset->getRdataIterator();
- it->first();
EXPECT_EQ(createRdata(RRType::A(), RRClass::IN(), "192.0.2.101")->toText(),
it->getCurrent().toText());
it->next();
Modified: branches/trac412/src/lib/datasrc/tests/sqlite3_unittest.cc
==============================================================================
--- branches/trac412/src/lib/datasrc/tests/sqlite3_unittest.cc (original)
+++ branches/trac412/src/lib/datasrc/tests/sqlite3_unittest.cc Tue Nov 30 13:20:42 2010
@@ -244,7 +244,6 @@
EXPECT_EQ(expected_rrttl, rrset->getTTL());
RdataIteratorPtr rdata_iterator = rrset->getRdataIterator();
- rdata_iterator->first();
vector<string>::const_iterator data_it = expected_data.begin();
for (; data_it != expected_data.end(); ++data_it) {
EXPECT_FALSE(rdata_iterator->isLast());
Modified: branches/trac412/src/lib/datasrc/tests/static_unittest.cc
==============================================================================
--- branches/trac412/src/lib/datasrc/tests/static_unittest.cc (original)
+++ branches/trac412/src/lib/datasrc/tests/static_unittest.cc Tue Nov 30 13:20:42 2010
@@ -109,7 +109,6 @@
EXPECT_EQ(rrttl, rrset->getTTL());
RdataIteratorPtr rdata_iterator = rrset->getRdataIterator();
- rdata_iterator->first();
vector<string>::const_iterator data_it = expected_data.begin();
for (; data_it != expected_data.end(); ++data_it) {
EXPECT_FALSE(rdata_iterator->isLast());
Modified: branches/trac412/src/lib/datasrc/tests/test_datasrc.cc
==============================================================================
--- branches/trac412/src/lib/datasrc/tests/test_datasrc.cc (original)
+++ branches/trac412/src/lib/datasrc/tests/test_datasrc.cc Tue Nov 30 13:20:42 2010
@@ -408,7 +408,7 @@
RRsetPtr rrset = RRsetPtr(new RRset(source->getName(), source->getClass(),
source->getType(), source->getTTL()));
RdataIteratorPtr it = source->getRdataIterator();
- for (it->first(); !it->isLast(); it->next()) {
+ for (; !it->isLast(); it->next()) {
rrset->addRdata(it->getCurrent());
}
if (source->getRRsig()) {
Modified: branches/trac412/src/lib/dns/Makefile.am
==============================================================================
--- branches/trac412/src/lib/dns/Makefile.am (original)
+++ branches/trac412/src/lib/dns/Makefile.am Tue Nov 30 13:20:42 2010
@@ -13,6 +13,8 @@
# TODO: double-check that this is the only way
# NOTE: when an rdata file is added, please also add to this list:
+EXTRA_DIST += rdata/any_255/tsig_250.cc
+EXTRA_DIST += rdata/any_255/tsig_250.h
EXTRA_DIST += rdata/in_1/aaaa_28.cc
EXTRA_DIST += rdata/in_1/aaaa_28.h
EXTRA_DIST += rdata/in_1/a_1.cc
@@ -81,7 +83,7 @@
libdns___la_SOURCES += rrtype.cc
libdns___la_SOURCES += question.h question.cc
libdns___la_SOURCES += util/sha1.h util/sha1.cc
-libdns___la_SOURCES += tsig.h tsig.cc
+libdns___la_SOURCES += tsigkey.h tsigkey.cc
nodist_libdns___la_SOURCES = rdataclass.cc rrclass.h rrtype.h
nodist_libdns___la_SOURCES += rrparamregistry.cc
@@ -96,11 +98,13 @@
libdns___include_HEADERS = \
buffer.h \
dnssectime.h \
+ edns.h \
exceptions.h \
message.h \
messagerenderer.h \
name.h \
question.h \
+ rcode.h \
rdata.h \
rdataclass.h \
rrclass.h \
@@ -109,7 +113,7 @@
rrsetlist.h \
rrttl.h \
rrtype.h \
- tsig.h
+ tsigkey.h
# Purposely not installing these headers:
# util/*.h: used only internally, and not actually DNS specific
# rrclass-placeholder.h
Modified: branches/trac412/src/lib/dns/python/Makefile.am
==============================================================================
--- branches/trac412/src/lib/dns/python/Makefile.am (original)
+++ branches/trac412/src/lib/dns/python/Makefile.am Tue Nov 30 13:20:42 2010
@@ -24,6 +24,7 @@
EXTRA_DIST += rrttl_python.cc
EXTRA_DIST += rdata_python.cc
EXTRA_DIST += rrtype_python.cc
+EXTRA_DIST += tsigkey_python.cc
# Python prefers .so, while some OSes (specifically MacOS) use a different
# suffix for dynamic objects. -module is necessary to work this around.
Modified: branches/trac412/src/lib/dns/python/pydnspp.cc
==============================================================================
--- branches/trac412/src/lib/dns/python/pydnspp.cc (original)
+++ branches/trac412/src/lib/dns/python/pydnspp.cc Tue Nov 30 13:20:42 2010
@@ -57,6 +57,7 @@
#include <dns/python/rrset_python.cc> // needs Rdata, RRTTL
#include <dns/python/question_python.cc> // needs RRClass, RRType, RRTTL,
// Name
+#include <dns/python/tsigkey_python.cc> // needs Name
#include <dns/python/opcode_python.cc>
#include <dns/python/rcode_python.cc>
#include <dns/python/edns_python.cc> // needs Messagerenderer, Rcode
@@ -146,6 +147,14 @@
return (NULL);
}
+ if (!initModulePart_TSIGKey(mod)) {
+ return (NULL);
+ }
+
+ if (!initModulePart_TSIGKeyRing(mod)) {
+ return (NULL);
+ }
+
return (mod);
}
Modified: branches/trac412/src/lib/dns/python/rrset_python.cc
==============================================================================
--- branches/trac412/src/lib/dns/python/rrset_python.cc (original)
+++ branches/trac412/src/lib/dns/python/rrset_python.cc Tue Nov 30 13:20:42 2010
@@ -355,7 +355,7 @@
RdataIteratorPtr it = self->rrset->getRdataIterator();
- for (it->first(); !it->isLast(); it->next()) {
+ for (; !it->isLast(); it->next()) {
s_Rdata *rds = static_cast<s_Rdata*>(rdata_type.tp_alloc(&rdata_type, 0));
if (rds != NULL) {
// hmz them iterators/shared_ptrs and private constructors
Modified: branches/trac412/src/lib/dns/python/tests/Makefile.am
==============================================================================
--- branches/trac412/src/lib/dns/python/tests/Makefile.am (original)
+++ branches/trac412/src/lib/dns/python/tests/Makefile.am Tue Nov 30 13:20:42 2010
@@ -10,6 +10,7 @@
PYTESTS += rrset_python_test.py
PYTESTS += rrttl_python_test.py
PYTESTS += rrtype_python_test.py
+PYTESTS += tsigkey_python_test.py
EXTRA_DIST = $(PYTESTS)
EXTRA_DIST += testutil.py
Modified: branches/trac412/src/lib/dns/rrclass-placeholder.h
==============================================================================
--- branches/trac412/src/lib/dns/rrclass-placeholder.h (original)
+++ branches/trac412/src/lib/dns/rrclass-placeholder.h Tue Nov 30 13:20:42 2010
@@ -244,14 +244,12 @@
// END_WELL_KNOWN_CLASS_DECLARATIONS
static const RRClass& NONE();
- static const RRClass& ANY();
private:
// \brief Meta-classes
enum {
RRCLASS_RESERVED0 = 0,
- RRCLASS_NONE = 254,
- RRCLASS_ANY = 255
+ RRCLASS_NONE = 254
};
uint16_t classcode_;
};
@@ -262,13 +260,6 @@
inline const RRClass&
RRClass::NONE() {
static RRClass rrclass(RRCLASS_NONE);
-
- return (rrclass);
-}
-
-inline const RRClass&
-RRClass::ANY() {
- static RRClass rrclass(RRCLASS_ANY);
return (rrclass);
}
Modified: branches/trac412/src/lib/dns/rrset.cc
==============================================================================
--- branches/trac412/src/lib/dns/rrset.cc (original)
+++ branches/trac412/src/lib/dns/rrset.cc Tue Nov 30 13:20:42 2010
@@ -44,7 +44,6 @@
string s;
RdataIteratorPtr it = getRdataIterator();
- it->first();
if (it->isLast()) {
isc_throw(EmptyRRset, "ToText() is attempted for an empty RRset");
}
@@ -66,7 +65,6 @@
unsigned int n = 0;
RdataIteratorPtr it = rrset.getRdataIterator();
- it->first();
if (it->isLast()) {
isc_throw(EmptyRRset, "ToWire() is attempted for an empty RRset");
}
@@ -224,7 +222,8 @@
BasicRdataIterator() {}
public:
BasicRdataIterator(const std::vector<rdata::ConstRdataPtr>& datavector) :
- datavector_(&datavector) {}
+ datavector_(&datavector), it_(datavector_->begin())
+ {}
~BasicRdataIterator() {}
virtual void first() { it_ = datavector_->begin(); }
virtual void next() { ++it_; }
Modified: branches/trac412/src/lib/dns/rrset.h
==============================================================================
--- branches/trac412/src/lib/dns/rrset.h (original)
+++ branches/trac412/src/lib/dns/rrset.h Tue Nov 30 13:20:42 2010
@@ -148,7 +148,7 @@
/// "sort" and "search(find)" method?
/// - what about comparing two RRsets of the same type? If we need this,
/// should it compare rdata's as a set or as a list (i.e. compare
-/// each %rdata one by one or as a whole)? c.f. NLnet Labs' ldns
+/// each rdata one by one or as a whole)? c.f. NLnet Labs' ldns
/// (http://www.nlnetlabs.nl/projects/ldns/doc/index.html)
/// has \c ldns_rr_list_compare(), which takes the latter approach
/// (seemingly assuming the caller sorts the lists beforehand).
@@ -357,7 +357,7 @@
/// \endcode
///
/// This method is more strictly typed than the pointer version:
- /// If \c %rdata does not refer to the appropriate derived
+ /// If \c rdata does not refer to the appropriate derived
/// \c Rdata class
/// for the \c RRType for this \c RRset, it throws an exception of class
/// \c std::bad_cast.
@@ -385,6 +385,10 @@
/// \brief Return an iterator to go through all RDATA stored in the
/// \c RRset.
///
+ /// The rdata cursor of the returned iterator will point to the first
+ /// RDATA, that is, it effectively calls \c RdataIterator::first()
+ /// internally.
+ ///
/// Using the design pattern terminology, \c getRdataIterator()
/// is an example of a <em>factory method</em>.
///
@@ -417,10 +421,10 @@
/// The RDATA objects stored in the \c RRset are considered to form
/// a unidirectional list from the \c RdataIterator point of view (while
/// the actual implementation in the derived \c RRset may not use a list).
-/// We call this unidirectional list the <em>%rdata list</em>.
+/// We call this unidirectional list the <em>rdata list</em>.
///
/// An \c RdataIterator object internally (and conceptually) holds a
-/// <em>%rdata cursor</em>, which points to a specific item of the %rdata list.
+/// <em>rdata cursor</em>, which points to a specific item of the rdata list.
///
/// Note about design choice: as is clear from the interface, \c RdataIterator
/// is not compatible with the standard iterator classes.
@@ -458,29 +462,29 @@
//@}
public:
- /// \brief Move the %rdata cursor to the first RDATA in the %rdata list
+ /// \brief Move the rdata cursor to the first RDATA in the rdata list
/// (if any).
///
/// This method can safely be called multiple times, even after moving
- /// the %rdata cursor forward by the \c next() method.
+ /// the rdata cursor forward by the \c next() method.
///
/// This method should never throw an exception.
virtual void first() = 0;
- /// \brief Move the %rdata cursor to the next RDATA in the %rdata list
+ /// \brief Move the rdata cursor to the next RDATA in the rdata list
/// (if any).
///
/// This method should never throw an exception.
virtual void next() = 0;
- /// \brief Return the current \c Rdata corresponding to the %rdata cursor.
+ /// \brief Return the current \c Rdata corresponding to the rdata cursor.
///
/// \return A reference to an \c rdata::::Rdata object corresponding
- /// to the %rdata cursor.
+ /// to the rdata cursor.
virtual const rdata::Rdata& getCurrent() const = 0;
- /// \brief Return true iff the %rdata cursor has reached the end of the
- /// %rdata list.
+ /// \brief Return true iff the rdata cursor has reached the end of the
+ /// rdata list.
///
/// Once this method returns \c true, the behavior of any subsequent
/// call to \c next() or \c getCurrent() is undefined.
@@ -489,8 +493,8 @@
///
/// This method should never throw an exception.
///
- /// \return \c true if the %rdata cursor has reached the end of the
- /// %rdata list; otherwise \c false.
+ /// \return \c true if the rdata cursor has reached the end of the
+ /// rdata list; otherwise \c false.
virtual bool isLast() const = 0;
};
Modified: branches/trac412/src/lib/dns/tests/Makefile.am
==============================================================================
--- branches/trac412/src/lib/dns/tests/Makefile.am (original)
+++ branches/trac412/src/lib/dns/tests/Makefile.am Tue Nov 30 13:20:42 2010
@@ -38,6 +38,7 @@
run_unittests_SOURCES += rdata_nsec3_unittest.cc
run_unittests_SOURCES += rdata_nsec3param_unittest.cc
run_unittests_SOURCES += rdata_rrsig_unittest.cc
+run_unittests_SOURCES += rdata_tsig_unittest.cc
run_unittests_SOURCES += rrset_unittest.cc rrsetlist_unittest.cc
run_unittests_SOURCES += question_unittest.cc
run_unittests_SOURCES += rrparamregistry_unittest.cc
@@ -46,7 +47,7 @@
run_unittests_SOURCES += base64_unittest.cc
run_unittests_SOURCES += hex_unittest.cc
run_unittests_SOURCES += sha1_unittest.cc
-run_unittests_SOURCES += tsig_unittest.cc
+run_unittests_SOURCES += tsigkey_unittest.cc
run_unittests_SOURCES += run_unittests.cc
run_unittests_CPPFLAGS = $(AM_CPPFLAGS) $(GTEST_INCLUDES)
run_unittests_LDFLAGS = $(AM_LDFLAGS) $(GTEST_LDFLAGS)
Modified: branches/trac412/src/lib/dns/tests/message_unittest.cc
==============================================================================
--- branches/trac412/src/lib/dns/tests/message_unittest.cc (original)
+++ branches/trac412/src/lib/dns/tests/message_unittest.cc Tue Nov 30 13:20:42 2010
@@ -293,7 +293,6 @@
// TTL should be 3600, even though that of the 2nd RR is 7200
EXPECT_EQ(RRTTL(3600), rrset->getTTL());
RdataIteratorPtr it = rrset->getRdataIterator();
- it->first();
EXPECT_EQ("192.0.2.1", it->getCurrent().toText());
it->next();
EXPECT_EQ("192.0.2.2", it->getCurrent().toText());
Modified: branches/trac412/src/lib/dns/tests/rrset_unittest.cc
==============================================================================
--- branches/trac412/src/lib/dns/tests/rrset_unittest.cc (original)
+++ branches/trac412/src/lib/dns/tests/rrset_unittest.cc Tue Nov 30 13:20:42 2010
@@ -117,8 +117,7 @@
addRdataTestCommon(const RRset& rrset) {
EXPECT_EQ(2, rrset.getRdataCount());
- RdataIteratorPtr it = rrset.getRdataIterator();
- it->first();
+ RdataIteratorPtr it = rrset.getRdataIterator(); // cursor is set to the 1st
EXPECT_FALSE(it->isLast());
EXPECT_EQ(0, it->getCurrent().compare(in::A("192.0.2.1")));
it->next();
@@ -156,7 +155,6 @@
TEST_F(RRsetTest, iterator) {
// Iterator for an empty RRset.
RdataIteratorPtr it = rrset_a_empty.getRdataIterator();
- it->first();
EXPECT_TRUE(it->isLast());
// Normal case (already tested, but do it again just in case)
Modified: branches/trac412/src/lib/dns/tests/rrsetlist_unittest.cc
==============================================================================
--- branches/trac412/src/lib/dns/tests/rrsetlist_unittest.cc (original)
+++ branches/trac412/src/lib/dns/tests/rrsetlist_unittest.cc Tue Nov 30 13:20:42 2010
@@ -150,7 +150,6 @@
RdataIteratorPtr it =
list.findRRset(RRType::A(), RRClass::IN())->getRdataIterator();
- it->first();
EXPECT_FALSE(it->isLast());
EXPECT_EQ("192.0.2.1", it->getCurrent().toText());
}
Modified: branches/trac412/src/lib/dns/tests/testdata/Makefile.am
==============================================================================
--- branches/trac412/src/lib/dns/tests/testdata/Makefile.am (original)
+++ branches/trac412/src/lib/dns/tests/testdata/Makefile.am Tue Nov 30 13:20:42 2010
@@ -12,6 +12,14 @@
BUILT_SOURCES += rdata_soa_toWireUncompressed.wire
BUILT_SOURCES += rdata_txt_fromWire2.wire rdata_txt_fromWire3.wire
BUILT_SOURCES += rdata_txt_fromWire4.wire rdata_txt_fromWire5.wire
+BUILT_SOURCES += rdata_tsig_fromWire1.wire rdata_tsig_fromWire2.wire
+BUILT_SOURCES += rdata_tsig_fromWire3.wire rdata_tsig_fromWire4.wire
+BUILT_SOURCES += rdata_tsig_fromWire5.wire rdata_tsig_fromWire6.wire
+BUILT_SOURCES += rdata_tsig_fromWire7.wire rdata_tsig_fromWire8.wire
+BUILT_SOURCES += rdata_tsig_fromWire9.wire
+BUILT_SOURCES += rdata_tsig_toWire1.wire rdata_tsig_toWire2.wire
+BUILT_SOURCES += rdata_tsig_toWire3.wire rdata_tsig_toWire4.wire
+BUILT_SOURCES += rdata_tsig_toWire5.wire
# NOTE: keep this in sync with real file listing
# so is included in tarball
@@ -51,6 +59,14 @@
EXTRA_DIST += rrcode16_fromWire1 rrcode16_fromWire2
EXTRA_DIST += rrcode32_fromWire1 rrcode32_fromWire2
EXTRA_DIST += rrset_toWire1 rrset_toWire2
+EXTRA_DIST += rdata_tsig_fromWire1.spec rdata_tsig_fromWire2.spec
+EXTRA_DIST += rdata_tsig_fromWire3.spec rdata_tsig_fromWire4.spec
+EXTRA_DIST += rdata_tsig_fromWire5.spec rdata_tsig_fromWire6.spec
+EXTRA_DIST += rdata_tsig_fromWire7.spec rdata_tsig_fromWire8.spec
+EXTRA_DIST += rdata_tsig_fromWire9.spec
+EXTRA_DIST += rdata_tsig_toWire1.spec rdata_tsig_toWire2.spec
+EXTRA_DIST += rdata_tsig_toWire3.spec rdata_tsig_toWire4.spec
+EXTRA_DIST += rdata_tsig_toWire5.spec
.spec.wire:
./gen-wiredata.py -o $@ $<
Modified: branches/trac412/src/lib/dns/tests/testdata/gen-wiredata.py.in
==============================================================================
--- branches/trac412/src/lib/dns/tests/testdata/gen-wiredata.py.in (original)
+++ branches/trac412/src/lib/dns/tests/testdata/gen-wiredata.py.in Tue Nov 30 13:20:42 2010
@@ -19,8 +19,8 @@
from datetime import datetime
from optparse import OptionParser
-re_hex = re.compile(r'0x[0-9a-fA-F]+')
-re_decimal = re.compile(r'\d+$')
+re_hex = re.compile(r'^0x[0-9a-fA-F]+')
+re_decimal = re.compile(r'^\d+$')
re_string = re.compile(r"\'(.*)\'$")
dnssec_timefmt = '%Y%m%d%H%M%S'
@@ -48,9 +48,12 @@
'maila' : 254, 'any' : 255 }
rdict_rrtype = dict([(dict_rrtype[k], k.upper()) for k in dict_rrtype.keys()])
dict_rrclass = { 'in' : 1, 'ch' : 3, 'hs' : 4, 'any' : 255 }
-rdict_rrclass = dict([(dict_rrclass[k], k.upper()) for k in dict_rrclass.keys()])
-dict_algorithm = { 'rsamd5' : 1, 'dh' : 2, 'dsa' : 3, 'ecc' : 4, 'rsasha1' : 5 }
-rdict_algorithm = dict([(dict_algorithm[k], k.upper()) for k in dict_algorithm.keys()])
+rdict_rrclass = dict([(dict_rrclass[k], k.upper()) for k in \
+ dict_rrclass.keys()])
+dict_algorithm = { 'rsamd5' : 1, 'dh' : 2, 'dsa' : 3, 'ecc' : 4,
+ 'rsasha1' : 5 }
+rdict_algorithm = dict([(dict_algorithm[k], k.upper()) for k in \
+ dict_algorithm.keys()])
header_xtables = { 'qr' : dict_qr, 'opcode' : dict_opcode,
'rcode' : dict_rcode }
@@ -75,13 +78,17 @@
return dict[code] + '(' + str(code) + ')'
return str(code)
-def encode_name(name, absolute = True):
+def encode_name(name, absolute=True):
# make sure the name is dot-terminated. duplicate dots will be ignored
# below.
name += '.'
labels = name.split('.')
wire = ''
for l in labels:
+ if len(l) > 4 and l[0:4] == 'ptr=':
+ # special meta-syntax for compression pointer
+ wire += ' %04x' % (0xc000 | int(l[4:]))
+ break
if absolute or len(l) > 0:
wire += '%02x' % len(l)
wire += ''.join(['%02x' % ord(ch) for ch in l])
@@ -89,7 +96,9 @@
break
return wire
-def encode_string(name):
+def encode_string(name, len=None):
+ if type(name) is int and len is not None:
+ return '%0.*x' % (len * 2, name)
return ''.join(['%02x' % ord(ch) for ch in name])
def count_namelabels(name):
@@ -121,17 +130,19 @@
class Name:
name = 'example.com'
- pointer = -1 # no compression by default
- def dump(self, f):
- name_wire = encode_name(self.name,
- True if self.pointer == -1 else False)
+ pointer = None # no compression by default
+ def dump(self, f):
+ name = self.name
+ if self.pointer is not None:
+ if len(name) > 0 and name[-1] != '.':
+ name += '.'
+ name += 'ptr=%d' % self.pointer
+ name_wire = encode_name(name)
f.write('\n# DNS Name: %s' % self.name)
- if self.pointer >= 0:
+ if self.pointer is not None:
f.write(' + compression pointer: %d' % self.pointer)
f.write('\n')
f.write('%s' % name_wire)
- if self.pointer >= 0:
- f.write(' %04x' % (0xc000 | self.pointer))
f.write('\n')
class DNSHeader:
@@ -338,20 +349,73 @@
(code_totext(self.covered, rdict_rrtype),
code_totext(self.algorithm, rdict_algorithm), labels,
self.originalttl))
- f.write('%04x %02x %02x %08x\n' % (self.covered, self.algorithm, labels,
- self.originalttl))
+ f.write('%04x %02x %02x %08x\n' % (self.covered, self.algorithm,
+ labels, self.originalttl))
f.write('# Expiration=%s, Inception=%s\n' %
(str(self.expiration), str(self.inception)))
f.write('%08x %08x\n' % (self.expiration, self.inception))
f.write('# Tag=%d Signer=%s and Signature\n' % (self.tag, self.signer))
f.write('%04x %s %s\n' % (self.tag, name_wire, sig_wire))
+class TSIG:
+ rdlen = None # auto-calculate
+ algorithm = 'hmac-sha256'
+ time_signed = 1286978795 # arbitrarily chosen default
+ fudge = 300
+ mac_size = None # use a common value for the algorithm
+ mac = None # use 'x' * mac_size
+ original_id = 2845 # arbitrarily chosen default
+ error = 0
+ other_len = None # 6 if error is BADTIME; otherwise 0
+ other_data = None # use time_signed + fudge + 1 for BADTIME
+ dict_macsize = { 'hmac-md5' : 16, 'hmac-sha1' : 20, 'hmac-sha256' : 32 }
+ def dump(self, f):
+ if str(self.algorithm) == 'hmac-md5':
+ name_wire = encode_name('hmac-md5.sig-alg.reg.int')
+ else:
+ name_wire = encode_name(self.algorithm)
+ rdlen = self.rdlen
+ mac_size = self.mac_size
+ if mac_size is None:
+ if self.algorithm in self.dict_macsize.keys():
+ mac_size = self.dict_macsize[self.algorithm]
+ else:
+ raise RuntimeError('TSIG Mac Size cannot be determined')
+ mac = encode_string('x' * mac_size) if self.mac is None else \
+ encode_string(self.mac, mac_size)
+ other_len = self.other_len
+ if other_len is None:
+ # 18 = BADTIME
+ other_len = 6 if self.error == 18 else 0
+ other_data = self.other_data
+ if other_data is None:
+ other_data = '%012x' % (self.time_signed + self.fudge + 1) \
+ if self.error == 18 else ''
+ else:
+ other_data = encode_string(self.other_data, other_len)
+ if rdlen is None:
+ rdlen = int(len(name_wire) / 2 + 16 + len(mac) / 2 + \
+ len(other_data) / 2)
+ f.write('\n# TSIG RDATA (RDLEN=%d)\n' % rdlen)
+ f.write('%04x\n' % rdlen);
+ f.write('# Algorithm=%s Time-Signed=%d Fudge=%d\n' %
+ (self.algorithm, self.time_signed, self.fudge))
+ f.write('%s %012x %04x\n' % (name_wire, self.time_signed, self.fudge))
+ f.write('# MAC Size=%d MAC=(see hex)\n' % mac_size)
+ f.write('%04x%s\n' % (mac_size, ' ' + mac if len(mac) > 0 else ''))
+ f.write('# Original-ID=%d Error=%d\n' % (self.original_id, self.error))
+ f.write('%04x %04x\n' % (self.original_id, self.error))
+ f.write('# Other-Len=%d Other-Data=(see hex)\n' % other_len)
+ f.write('%04x%s\n' % (other_len,
+ ' ' + other_data if len(other_data) > 0 else ''))
+
def get_config_param(section):
config_param = {'name' : (Name, {}),
'header' : (DNSHeader, header_xtables),
'question' : (DNSQuestion, question_xtables),
'edns' : (EDNS, {}), 'soa' : (SOA, {}), 'txt' : (TXT, {}),
- 'rrsig' : (RRSIG, {}), 'nsec' : (NSEC, {})}
+ 'rrsig' : (RRSIG, {}), 'nsec' : (NSEC, {}),
+ 'tsig' : (TSIG, {}) }
s = section
m = re.match('^([^:]+)/\d+$', section)
if m:
Modified: branches/trac412/src/lib/python/isc/datasrc/Makefile.am
==============================================================================
--- branches/trac412/src/lib/python/isc/datasrc/Makefile.am (original)
+++ branches/trac412/src/lib/python/isc/datasrc/Makefile.am Tue Nov 30 13:20:42 2010
@@ -1,3 +1,5 @@
+SUBDIRS = . tests
+
python_PYTHON = __init__.py master.py sqlite3_ds.py
pythondir = $(pyexecdir)/isc/datasrc
Modified: branches/trac412/src/lib/python/isc/datasrc/master.py
==============================================================================
--- branches/trac412/src/lib/python/isc/datasrc/master.py (original)
+++ branches/trac412/src/lib/python/isc/datasrc/master.py Tue Nov 30 13:20:42 2010
@@ -103,7 +103,7 @@
# isttl: check whether a string is a valid TTL specifier.
# returns: boolean
#########################################################################
-ttl_regex = re.compile('([0-9]+[wdhms]?)+', re.I)
+ttl_regex = re.compile('([0-9]+[wdhms]?)+$', re.I)
def isttl(s):
global ttl_regex
if ttl_regex.match(s):
More information about the bind10-changes
mailing list