Commit a80861a9 authored by JINMEI Tatuya's avatar JINMEI Tatuya
Browse files

sync with trunk, resolving a conflict.


git-svn-id: svn://bind10.isc.org/svn/bind10/branches/trac446@3997 e5f2f494-b856-4b98-b285-d166d9295462
parents f04d4835 05b245d8
137. [bug] jreed
Fix run_*.sh scripts that are used for development testing
so they use a msgq socket file in the build tree.
(Trac #226, svn r3989)
136. [bug] jelte
bindctl (and the configuration manager in general) now no longer
accepts 'unknown' data; i.e. data for modules that it does not know
about, or configuration items that are not specified in the .spec
files.
(Trac #202, svn r3967)
135. [func] each
Add b10-recurse. This is an example recursive server that
currently does forwarding only and no caching.
(Trac #327, svn r3903)
134. [func] vorner
b10-recurse supports timeouts and retries in forwarder mode.
(Trac #401, svn r3660)
......@@ -8,7 +25,7 @@
(Trac #393, r3602)
132. [func] vorner
The b10-recursive is configured through config manager.
The b10-recurse is configured through config manager.
It has "listen_on" and "forward_addresses" options.
(Trac #389, r3448)
......@@ -39,7 +56,6 @@
for root zone was added.
(Trac #85, svn r3836)
>>>>>>> .merge-right.r3894
127. [bug] stephen
During normal operation process termination and resurrection messages
are now output regardless of the state of the verbose flag.
......
......@@ -18,6 +18,7 @@
#include <dns/rrtype.h>
#include <datasrc/zonetable.h>
#include <datasrc/memory_datasrc.h>
#include <auth/query.h>
......
......@@ -46,5 +46,5 @@ BIND10_MSGQ_SOCKET_FILE=@abs_top_builddir@/msgq_socket
export BIND10_MSGQ_SOCKET_FILE
cd ${BIND10_PATH}
exec ${PYTHON_EXEC} -O bind10 $*
exec ${PYTHON_EXEC} -O bind10 "$@"
......@@ -26,5 +26,8 @@ export PYTHONPATH
B10_FROM_SOURCE=@abs_top_srcdir@
export B10_FROM_SOURCE
BIND10_MSGQ_SOCKET_FILE=@abs_top_builddir@/msgq_socket
export BIND10_MSGQ_SOCKET_FILE
cd ${BINDCTL_PATH}
exec ${PYTHON_EXEC} -O bindctl $*
exec ${PYTHON_EXEC} -O bindctl "$@"
......@@ -22,6 +22,8 @@ CMD_CTRLD_PATH=@abs_top_builddir@/src/bin/cmdctl
PYTHONPATH=@abs_top_srcdir@/src/lib/python
export PYTHONPATH
cd ${CMD_CTRLD_PATH}
${PYTHON_EXEC} b10-cmdctl
BIND10_MSGQ_SOCKET_FILE=@abs_top_builddir@/msgq_socket
export BIND10_MSGQ_SOCKET_FILE
cd ${CMD_CTRLD_PATH}
exec ${PYTHON_EXEC} b10-cmdctl "$@"
......@@ -21,5 +21,8 @@ export PYTHON_EXEC
PYTHONPATH=@abs_top_builddir@/src/lib/python
export PYTHONPATH
BIND10_MSGQ_SOCKET_FILE=@abs_top_builddir@/msgq_socket
export BIND10_MSGQ_SOCKET_FILE
LOADZONE_PATH=@abs_top_builddir@/src/bin/loadzone
exec ${LOADZONE_PATH}/b10-loadzone $*
exec ${LOADZONE_PATH}/b10-loadzone "$@"
......@@ -23,5 +23,8 @@ MYPATH_PATH=@abs_top_builddir@/src/bin/msgq
PYTHONPATH=@abs_top_srcdir@/src/lib/python
export PYTHONPATH
BIND10_MSGQ_SOCKET_FILE=@abs_top_builddir@/msgq_socket
export BIND10_MSGQ_SOCKET_FILE
cd ${MYPATH_PATH}
exec ${PYTHON_EXEC} -O b10-msgq $*
exec ${PYTHON_EXEC} -O b10-msgq "$@"
......@@ -21,10 +21,13 @@ export PYTHON_EXEC
PYTHONPATH=@abs_top_builddir@/src/lib/python
export PYTHONPATH
BIND10_MSGQ_SOCKET_FILE=@abs_top_builddir@/msgq_socket
export BIND10_MSGQ_SOCKET_FILE
B10_FROM_BUILD=@abs_top_builddir@
export B10_FROM_BUILD
STATS_PATH=@abs_top_builddir@/src/bin/stats
cd ${STATS_PATH}
exec ${PYTHON_EXEC} -O b10-stats $*
exec ${PYTHON_EXEC} -O b10-stats "$@"
......@@ -24,7 +24,10 @@ export PYTHONPATH
B10_FROM_BUILD=@abs_top_srcdir@
export B10_FROM_BUILD
BIND10_MSGQ_SOCKET_FILE=@abs_top_builddir@/msgq_socket
export BIND10_MSGQ_SOCKET_FILE
STATS_PATH=@abs_top_builddir@/src/bin/stats
cd ${STATS_PATH}
exec ${PYTHON_EXEC} -O b10-stats_stub $*
exec ${PYTHON_EXEC} -O b10-stats_stub "$@"
......@@ -20,6 +20,8 @@ export PYTHON_EXEC
MYPATH_PATH=@abs_top_builddir@/src/bin/usermgr
cd ${MYPATH_PATH}
${PYTHON_EXEC} b10-cmdctl-usermgr
BIND10_MSGQ_SOCKET_FILE=@abs_top_builddir@/msgq_socket
export BIND10_MSGQ_SOCKET_FILE
cd ${MYPATH_PATH}
exec ${PYTHON_EXEC} b10-cmdctl-usermgr "$@"
......@@ -22,6 +22,8 @@ MYPATH_PATH=@abs_top_builddir@/src/bin/xfrin
PYTHONPATH=@abs_top_srcdir@/src/lib/python:@abs_top_builddir@/src/lib/dns/.libs
export PYTHONPATH
cd ${MYPATH_PATH}
${PYTHON_EXEC} b10-xfrin
BIND10_MSGQ_SOCKET_FILE=@abs_top_builddir@/msgq_socket
export BIND10_MSGQ_SOCKET_FILE
cd ${MYPATH_PATH}
exec ${PYTHON_EXEC} b10-xfrin "$@"
......@@ -22,6 +22,8 @@ MYPATH_PATH=@abs_top_builddir@/src/bin/xfrout
PYTHONPATH=@abs_top_srcdir@/src/lib/python:@abs_top_builddir@/src/lib/xfr/.libs:@abs_top_builddir@/src/lib/dns/python/.libs
export PYTHONPATH
cd ${MYPATH_PATH}
${PYTHON_EXEC} b10-xfrout
BIND10_MSGQ_SOCKET_FILE=@abs_top_builddir@/msgq_socket
export BIND10_MSGQ_SOCKET_FILE
cd ${MYPATH_PATH}
exec ${PYTHON_EXEC} b10-xfrout "$@"
......@@ -22,6 +22,8 @@ MYPATH_PATH=@abs_top_builddir@/src/bin/zonemgr
PYTHONPATH=@abs_top_srcdir@/src/lib/python:@abs_top_builddir@/src/lib/dns/.libs
export PYTHONPATH
cd ${MYPATH_PATH}
${PYTHON_EXEC} b10-zonemgr
BIND10_MSGQ_SOCKET_FILE=@abs_top_builddir@/msgq_socket
export BIND10_MSGQ_SOCKET_FILE
cd ${MYPATH_PATH}
exec ${PYTHON_EXEC} b10-zonemgr "$@"
......@@ -330,13 +330,32 @@ bool
ModuleSpec::validate_spec_list(ConstElementPtr spec, ConstElementPtr data,
const bool full, ElementPtr errors) const
{
bool validated = true;
std::string cur_item_name;
BOOST_FOREACH(ConstElementPtr cur_spec_el, spec->listValue()) {
if (!validate_spec(cur_spec_el, data, full, errors)) {
return (false);
validated = false;
}
}
return (true);
typedef std::pair<std::string, ConstElementPtr> maptype;
BOOST_FOREACH(maptype m, data->mapValue()) {
bool found = false;
BOOST_FOREACH(ConstElementPtr cur_spec_el, spec->listValue()) {
if (cur_spec_el->get("item_name")->stringValue().compare(m.first) == 0) {
found = true;
}
}
if (!found) {
validated = false;
if (errors) {
errors->add(Element::create("Unknown item " + m.first));
}
}
}
return (validated);
}
}
......
......@@ -166,8 +166,13 @@ TEST(ModuleSpec, DataValidation) {
EXPECT_TRUE(data_test(dd, "data22_6.data"));
EXPECT_TRUE(data_test(dd, "data22_7.data"));
EXPECT_FALSE(data_test(dd, "data22_8.data"));
EXPECT_FALSE(data_test(dd, "data22_9.data"));
ElementPtr errors = Element::createList();
EXPECT_FALSE(data_test_with_errors(dd, "data22_8.data", errors));
EXPECT_EQ("[ \"Type mismatch\" ]", errors->str());
errors = Element::createList();
EXPECT_FALSE(data_test_with_errors(dd, "data22_9.data", errors));
EXPECT_EQ("[ \"Unknown item value_does_not_exist\" ]", errors->str());
}
......@@ -20,6 +20,7 @@ EXTRA_DIST += data22_5.data
EXTRA_DIST += data22_6.data
EXTRA_DIST += data22_7.data
EXTRA_DIST += data22_8.data
EXTRA_DIST += data22_9.data
EXTRA_DIST += spec1.spec
EXTRA_DIST += spec2.spec
EXTRA_DIST += spec3.spec
......
......@@ -5,5 +5,6 @@
"value4": "foo",
"value5": [ 1, 2, 3 ],
"value6": { "v61": "bar", "v62": true },
"value8": [ { "a": "d" }, { "a": 1 } ]
"value8": [ { "a": "d" }, { "a": 1 } ],
"value9": { "v91": "hi", "v92": { "v92a": "Hi", "v92b": 3 } }
}
{
"value1": 1,
"value2": 2.3,
"value3": true,
"value4": "foo",
"value5": [ 1, 2, 3 ],
"value6": { "v61": "bar", "v62": true },
"value8": [ { "a": "d" }, { "a": "e" } ],
"value9": { "v91": "hi", "v92": { "v92a": "Hi", "v92b": 3 } },
"value_does_not_exist": 1
}
......@@ -15,6 +15,8 @@ libdatasrc_la_SOURCES += static_datasrc.h static_datasrc.cc
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 += rbtree.h
libdatasrc_la_SOURCES += rbtree.h
libdatasrc_la_SOURCES += zonetable.h zonetable.cc
libdatasrc_la_SOURCES += memory_datasrc.h memory_datasrc.cc
libdatasrc_la_SOURCES += zone.h
libdatasrc_la_SOURCES += result.h
......@@ -12,8 +12,14 @@
// OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
// PERFORMANCE OF THIS SOFTWARE.
#include <map>
#include <boost/shared_ptr.hpp>
#include <dns/name.h>
#include <dns/rrclass.h>
#include <datasrc/memory_datasrc.h>
#include <datasrc/rbtree.h>
using namespace std;
using namespace isc::dns;
......@@ -21,6 +27,63 @@ using namespace isc::dns;
namespace isc {
namespace datasrc {
// Private data and hidden methods of MemoryZone
struct MemoryZone::MemoryZoneImpl {
// Constructor
MemoryZoneImpl(const RRClass& zone_class, const Name& origin) :
zone_class_(zone_class), origin_(origin)
{}
// Information about the zone
RRClass zone_class_;
Name origin_;
// Some type aliases
/*
* Each domain consists of some RRsets. They will be looked up by the
* RRType.
*
* The use of map is questionable with regard to performance - there'll
* be usually only few RRsets in the domain, so the log n benefit isn't
* much and a vector/array might be faster due to its simplicity and
* continuous memory location. But this is unlikely to be a performance
* critical place and map has better interface for the lookups, so we use
* that.
*/
typedef map<RRType, ConstRRsetPtr> Domain;
typedef boost::shared_ptr<Domain> DomainPtr;
// The tree stores domains
typedef RBTree<Domain> DomainTree;
typedef RBNode<Domain> DomainNode;
// The actual zone data
DomainTree domains_;
};
MemoryZone::MemoryZone(const RRClass& zone_class, const Name& origin) :
impl_(new MemoryZoneImpl(zone_class, origin))
{
}
MemoryZone::~MemoryZone() {
delete impl_;
}
const Name&
MemoryZone::getOrigin() const {
return (impl_->origin_);
}
const RRClass&
MemoryZone::getClass() const {
return (impl_->zone_class_);
}
Zone::FindResult
MemoryZone::find(const Name&, const RRType&) const {
// This is a tentative implementation that always returns NXDOMAIN.
return (FindResult(NXDOMAIN, RRsetPtr()));
}
/// Implementation details for \c MemoryDataSrc hidden from the public
/// interface.
///
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment