[svn] commit: r657 - in /experiments/each-query/src: bin/auth/ bin/bind10/ lib/auth/cpp/
BIND 10 source code commits
bind10-changes at lists.isc.org
Fri Jan 29 21:08:31 UTC 2010
Author: jelte
Date: Fri Jan 29 21:08:31 2010
New Revision: 657
Log:
made an auth_srv that creates a StaticDataSource and answers queries
it does not actually do anything with the queries and the datasource
updated data_source_static to modified data_source
commented out two pure virtuals in data_source for now (these will come back)
updated bind10.py to run b10-auth instead of parkinglot
Added:
experiments/each-query/src/bin/auth/auth_srv.cc
experiments/each-query/src/bin/auth/auth_srv.h
Modified:
experiments/each-query/src/bin/auth/Makefile.am
experiments/each-query/src/bin/auth/auth.spec
experiments/each-query/src/bin/auth/main.cc
experiments/each-query/src/bin/bind10/bind10.in
experiments/each-query/src/bin/bind10/bind10.py
experiments/each-query/src/lib/auth/cpp/Makefile.am
experiments/each-query/src/lib/auth/cpp/data_source.cc
experiments/each-query/src/lib/auth/cpp/data_source.h
experiments/each-query/src/lib/auth/cpp/data_source_static.cc
experiments/each-query/src/lib/auth/cpp/data_source_static.h
Modified: experiments/each-query/src/bin/auth/Makefile.am
==============================================================================
--- experiments/each-query/src/bin/auth/Makefile.am (original)
+++ experiments/each-query/src/bin/auth/Makefile.am Fri Jan 29 21:08:31 2010
@@ -1,9 +1,10 @@
AM_CPPFLAGS = -I$(top_srcdir)/src/lib -I$(top_srcdir)/ext
bin_PROGRAMS = b10-auth
-b10_auth_SOURCES = common.cc common.h
+b10_auth_SOURCES = auth_srv.cc auth_srv.h
+b10_auth_SOURCES += common.cc common.h
b10_auth_SOURCES += main.cc
-b10_auth_SOURCES += auth.cc auth.h
-b10_auth_LDADD = $(top_srcdir)/src/lib/dns/cpp/.libs/libdns.a
-b10_auth_LDADD += $(top_srcdir)/src/lib/auth/cpp/.libs/libauth.a
-b10_auth_LDADD += $(top_srcdir)/src/lib/config/cpp/libclient.a
+b10_auth_LDADD = $(top_builddir)/src/lib/dns/cpp/.libs/libdns.a
+b10_auth_LDADD += $(top_builddir)/src/lib/auth/cpp/.libs/libauth.a
+b10_auth_LDADD += $(top_builddir)/src/lib/config/cpp/libclient.a
+b10_auth_LDADD += $(top_builddir)/src/lib/cc/cpp/libcc.a
Modified: experiments/each-query/src/bin/auth/auth.spec
==============================================================================
--- experiments/each-query/src/bin/auth/auth.spec (original)
+++ experiments/each-query/src/bin/auth/auth.spec Fri Jan 29 21:08:31 2010
@@ -1,74 +1,6 @@
{
"data_specification": {
- "module_name": "ParkingLot",
- "config_data": [
- {
- "item_name": "port",
- "item_type": "integer",
- "item_optional": false,
- "item_default": 5300
- },
- {
- "item_name": "zones",
- "item_type": "list",
- "item_optional": false,
- "item_default": [ ],
- "list_item_spec": {
- "item_name": "zone_name",
- "item_type": "string",
- "item_optional": false,
- "item_default": ""
- }
- },
- {
- "item_name": "a_records",
- "item_type": "list",
- "item_optional": false,
- "item_default": [ "127.0.0.1" ],
- "list_item_spec": {
- "item_name": "address",
- "item_type": "string",
- "item_optional": false,
- "item_default": ""
- }
- },
- {
- "item_name": "aaaa_records",
- "item_type": "list",
- "item_optional": false,
- "item_default": [ "::1" ],
- "list_item_spec": {
- "item_name": "address",
- "item_type": "string",
- "item_optional": false,
- "item_default": ""
- }
- },
- {
- "item_name": "ns_records",
- "item_type": "list",
- "item_optional": false,
- "item_default": [ "ns1.parking.example", "ns2.parking.example" ],
- "list_item_spec": {
- "item_name": "address",
- "item_type": "string",
- "item_optional": false,
- "item_default": ""
- }
- }
- ],
- "commands": [
- {
- "command_name": "print_message",
- "command_description": "Print the given message to stdout",
- "command_args": [ {
- "item_name": "message",
- "item_type": "string",
- "item_optional": False,
- "item_default": ""
- } ]
- }
- ]
+ "module_name": "ParkingLot"
}
}
Modified: experiments/each-query/src/bin/auth/main.cc
==============================================================================
--- experiments/each-query/src/bin/auth/main.cc (original)
+++ experiments/each-query/src/bin/auth/main.cc Fri Jan 29 21:08:31 2010
@@ -36,7 +36,7 @@
#include "common.h"
#include "config.h"
-#include "auth.h"
+#include "auth_srv.h"
#include <boost/foreach.hpp>
@@ -48,7 +48,7 @@
/* need global var for config/command handlers.
* todo: turn this around, and put handlers in the authserver
* class itself? */
-AuthServer auth = AuthServer(DNSPORT);
+AuthSrv auth = AuthSrv(DNSPORT);
static void
usage() {
Modified: experiments/each-query/src/bin/bind10/bind10.in
==============================================================================
--- experiments/each-query/src/bin/bind10/bind10.in (original)
+++ experiments/each-query/src/bin/bind10/bind10.in Fri Jan 29 21:08:31 2010
@@ -5,7 +5,7 @@
BIND10_PATH=@abs_top_srcdir@/src/bin/bind10
-PATH=@abs_top_srcdir@/src/bin/msgq:@abs_top_srcdir@/src/bin/parkinglot:@abs_top_srcdir@/src/bin/bind-cfgd:@abs_top_srcdir@/src/bin/cmd-ctrld:$PATH
+PATH=@abs_top_srcdir@/src/bin/msgq:@abs_top_srcdir@/src/bin/auth:@abs_top_srcdir@/src/bin/bind-cfgd:@abs_top_srcdir@/src/bin/cmd-ctrld:$PATH
export PATH
PYTHONPATH=@abs_top_srcdir@/src/lib/cc/python:@abs_top_srcdir@/src/lib/config/python
Modified: experiments/each-query/src/bin/bind10/bind10.py
==============================================================================
--- experiments/each-query/src/bin/bind10/bind10.py (original)
+++ experiments/each-query/src/bin/bind10/bind10.py Fri Jan 29 21:08:31 2010
@@ -169,16 +169,16 @@
# XXX: this must be read from the configuration manager in the future
# XXX: we hardcode port 5300
if self.verbose:
- sys.stdout.write("Starting parkinglot on port 5300\n")
- try:
- parkinglot = ProcessInfo("parkinglot", ["parkinglot", "-p", "5300"])
+ sys.stdout.write("Starting auth server on port 5300\n")
+ try:
+ parkinglot = ProcessInfo("b10-auth", ["b10-auth", "-p", "5300"])
except Exception as e:
c_channel.process.kill()
bind_cfgd.process.kill()
- return "Unable to start parkinglot; " + str(e)
+ return "Unable to start auth-server b10-auth; " + str(e)
self.processes[parkinglot.pid] = parkinglot
if self.verbose:
- sys.stdout.write("Started parkinglot (PID %d)\n" % parkinglot.pid)
+ sys.stdout.write("Started auth server b10-auth (PID %d)\n" % parkinglot.pid)
# start the cmd-ctrld
# XXX: we hardcode port 8080
Modified: experiments/each-query/src/lib/auth/cpp/Makefile.am
==============================================================================
--- experiments/each-query/src/lib/auth/cpp/Makefile.am (original)
+++ experiments/each-query/src/lib/auth/cpp/Makefile.am Fri Jan 29 21:08:31 2010
@@ -5,6 +5,5 @@
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_static.h data_source_static.cc
#libauth_la_SOURCES += data_source_plot.h data_source_plot.cc
libauth_la_SOURCES += query.h query.cc
Modified: experiments/each-query/src/lib/auth/cpp/data_source.cc
==============================================================================
--- experiments/each-query/src/lib/auth/cpp/data_source.cc (original)
+++ experiments/each-query/src/lib/auth/cpp/data_source.cc Fri Jan 29 21:08:31 2010
@@ -12,19 +12,7 @@
DSResult
DataSrc::runQuery(Query q) {
- DSResult result;
- Name container("");
- RRsetList data, sigs;
- DataSrc* ds = findClosestEnclosure(q.qname(), container);
-
- if (q.wantDnssec()) {
- result = ds->findRRset(q.qname(), q.qclass(), q.qtype(), data, sigs);
- } else {
- result = ds->findRRset(q.qname(), q.qclass(), q.qtype(), data);
- }
-
- // XXX this is temporary
- return (result);
+ return SUCCESS;
};
Modified: experiments/each-query/src/lib/auth/cpp/data_source.h
==============================================================================
--- experiments/each-query/src/lib/auth/cpp/data_source.h (original)
+++ experiments/each-query/src/lib/auth/cpp/data_source.h Fri Jan 29 21:08:31 2010
@@ -37,7 +37,7 @@
class AbstractDataSrc {
public:
- virtual ~AbstractDataSrc();
+ virtual ~AbstractDataSrc() {};
// 'High-level' methods. These will be implemented by the
// general DataSrc class, but MAY be overwritten by subclasses.
@@ -64,8 +64,8 @@
virtual DSResult init() = 0;
virtual DSResult close() = 0;
- virtual const RRClass& getClass() const = 0;
- virtual const RRClass& setClass() const = 0;
+ //virtual const RRClass& getClass() const = 0;
+ //virtual const RRClass& setClass() const = 0;
};
// Base class for a DNS Data Source
@@ -80,13 +80,13 @@
virtual DSResult findRRset(const Name& qname,
const RRClass& qclass,
const RRType& qtype,
- RRset& target,
- RRset& sigs) = 0;
+ RRsetList& target,
+ RRsetList& sigs) const = 0;
virtual DSResult findRRset(const Name& qname,
const RRClass& qclass,
const RRType& qtype,
- RRsetList& target) = 0;
+ RRsetList& target) const = 0;
virtual const DataSrc* findClosestEnclosure(const Name& qname,
Name& container) const = 0;
Modified: experiments/each-query/src/lib/auth/cpp/data_source_static.cc
==============================================================================
--- experiments/each-query/src/lib/auth/cpp/data_source_static.cc (original)
+++ experiments/each-query/src/lib/auth/cpp/data_source_static.cc Fri Jan 29 21:08:31 2010
@@ -58,7 +58,7 @@
StaticDataSrc::findRRset(const Name& qname,
const RRClass& qclass,
const RRType& qtype,
- RRsetList& target, RRset& sigs) const
+ RRsetList& target) const
{
if (qname == version_name) {
target.push_back(version);
@@ -70,5 +70,14 @@
return NAME_NOT_FOUND;
}
+DSResult
+StaticDataSrc::findRRset(const Name& qname,
+ const RRClass& qclass,
+ const RRType& qtype,
+ RRsetList& target, RRsetList& sigs) const
+{
+ return findRRset(qname, qclass, qtype, target);
+}
+
}
}
Modified: experiments/each-query/src/lib/auth/cpp/data_source_static.h
==============================================================================
--- experiments/each-query/src/lib/auth/cpp/data_source_static.h (original)
+++ experiments/each-query/src/lib/auth/cpp/data_source_static.h Fri Jan 29 21:08:31 2010
@@ -25,7 +25,7 @@
#ifndef __STATIC_DATA_SOURCE_H
#define __STATIC_DATA_SOURCE_H
-#include <data_source.h>
+#include "data_source.h"
namespace isc {
namespace dns {
@@ -41,7 +41,12 @@
DSResult findRRset(const Name& qname,
const RRClass& qclass,
const RRType& qtype,
- RRsetList& target, RRset& sigs) const;
+ RRsetList& target, RRsetList& sigs) const;
+
+ DSResult findRRset(const Name& qname,
+ const RRClass& qclass,
+ const RRType& qtype,
+ RRsetList& target) const;
DSResult init() { return SUCCESS; };
DSResult close() { return SUCCESS; } ;
More information about the bind10-changes
mailing list