mirror of
https://gitlab.isc.org/isc-projects/kea
synced 2025-09-01 22:45:18 +00:00
Change libauth to libdatasrc
git-svn-id: svn://bind10.isc.org/svn/bind10/trunk@1799 e5f2f494-b856-4b98-b285-d166d9295462
This commit is contained in:
@@ -391,7 +391,7 @@ AC_CONFIG_FILES([Makefile
|
|||||||
src/lib/cc/Makefile
|
src/lib/cc/Makefile
|
||||||
src/lib/python/Makefile
|
src/lib/python/Makefile
|
||||||
src/lib/python/isc/Makefile
|
src/lib/python/isc/Makefile
|
||||||
src/lib/python/isc/auth/Makefile
|
src/lib/python/isc/datasrc/Makefile
|
||||||
src/lib/python/isc/cc/Makefile
|
src/lib/python/isc/cc/Makefile
|
||||||
src/lib/python/isc/cc/tests/Makefile
|
src/lib/python/isc/cc/tests/Makefile
|
||||||
src/lib/python/isc/config/Makefile
|
src/lib/python/isc/config/Makefile
|
||||||
@@ -401,8 +401,8 @@ AC_CONFIG_FILES([Makefile
|
|||||||
src/lib/dns/Makefile
|
src/lib/dns/Makefile
|
||||||
src/lib/dns/tests/Makefile
|
src/lib/dns/tests/Makefile
|
||||||
src/lib/exceptions/Makefile
|
src/lib/exceptions/Makefile
|
||||||
src/lib/auth/Makefile
|
src/lib/datasrc/Makefile
|
||||||
src/lib/auth/tests/Makefile
|
src/lib/datasrc/tests/Makefile
|
||||||
src/lib/xfr/Makefile
|
src/lib/xfr/Makefile
|
||||||
])
|
])
|
||||||
AC_OUTPUT([src/bin/cfgmgr/b10-cfgmgr.py
|
AC_OUTPUT([src/bin/cfgmgr/b10-cfgmgr.py
|
||||||
|
@@ -27,8 +27,8 @@ pkglibexec_PROGRAMS = b10-auth
|
|||||||
b10_auth_SOURCES = auth_srv.cc auth_srv.h
|
b10_auth_SOURCES = auth_srv.cc auth_srv.h
|
||||||
b10_auth_SOURCES += common.h
|
b10_auth_SOURCES += common.h
|
||||||
b10_auth_SOURCES += main.cc
|
b10_auth_SOURCES += main.cc
|
||||||
b10_auth_LDADD = $(top_builddir)/src/lib/auth/.libs/libauth.a
|
b10_auth_LDADD = $(top_builddir)/src/lib/datasrc/.libs/libdatasrc.a
|
||||||
b10_auth_LDADD += $(top_builddir)/src/lib/dns/.libs/libdns.a
|
b10_auth_LDADD += $(top_builddir)/src/lib/dns/.libs/libdns.a
|
||||||
b10_auth_LDADD += $(top_builddir)/src/lib/config/.libs/libcfgclient.a
|
b10_auth_LDADD += $(top_builddir)/src/lib/config/.libs/libcfgclient.a
|
||||||
b10_auth_LDADD += $(top_builddir)/src/lib/cc/libcc.a
|
b10_auth_LDADD += $(top_builddir)/src/lib/cc/libcc.a
|
||||||
b10_auth_LDADD += $(top_builddir)/src/lib/exceptions/.libs/libexceptions.a
|
b10_auth_LDADD += $(top_builddir)/src/lib/exceptions/.libs/libexceptions.a
|
||||||
|
@@ -33,10 +33,10 @@
|
|||||||
#include <cc/data.h>
|
#include <cc/data.h>
|
||||||
#include <exceptions/exceptions.h>
|
#include <exceptions/exceptions.h>
|
||||||
|
|
||||||
#include <auth/query.h>
|
#include <datasrc/query.h>
|
||||||
#include <auth/data_source.h>
|
#include <datasrc/data_source.h>
|
||||||
#include <auth/static_datasrc.h>
|
#include <datasrc/static_datasrc.h>
|
||||||
#include <auth/sqlite3_datasrc.h>
|
#include <datasrc/sqlite3_datasrc.h>
|
||||||
|
|
||||||
#include <cc/data.h>
|
#include <cc/data.h>
|
||||||
|
|
||||||
@@ -48,7 +48,7 @@
|
|||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
using namespace isc;
|
using namespace isc;
|
||||||
using namespace isc::auth;
|
using namespace isc::datasrc;
|
||||||
using namespace isc::dns;
|
using namespace isc::dns;
|
||||||
using namespace isc::dns::rdata;
|
using namespace isc::dns::rdata;
|
||||||
using namespace isc::data;
|
using namespace isc::data;
|
||||||
|
@@ -16,7 +16,7 @@ run_unittests_CPPFLAGS = $(AM_CPPFLAGS) $(GTEST_INCLUDES)
|
|||||||
run_unittests_LDFLAGS = $(AM_LDFLAGS) $(GTEST_LDFLAGS)
|
run_unittests_LDFLAGS = $(AM_LDFLAGS) $(GTEST_LDFLAGS)
|
||||||
run_unittests_LDADD = $(GTEST_LDADD)
|
run_unittests_LDADD = $(GTEST_LDADD)
|
||||||
run_unittests_LDADD += $(SQLITE_LIBS)
|
run_unittests_LDADD += $(SQLITE_LIBS)
|
||||||
run_unittests_LDADD += $(top_builddir)/src/lib/auth/.libs/libauth.a
|
run_unittests_LDADD += $(top_builddir)/src/lib/datasrc/.libs/libdatasrc.a
|
||||||
run_unittests_LDADD += $(top_builddir)/src/lib/dns/.libs/libdns.a
|
run_unittests_LDADD += $(top_builddir)/src/lib/dns/.libs/libdns.a
|
||||||
run_unittests_LDADD += $(top_builddir)/src/lib/config/.libs/libcfgclient.a
|
run_unittests_LDADD += $(top_builddir)/src/lib/config/.libs/libcfgclient.a
|
||||||
run_unittests_LDADD += $(top_builddir)/src/lib/cc/libcc.a
|
run_unittests_LDADD += $(top_builddir)/src/lib/cc/libcc.a
|
||||||
|
@@ -17,8 +17,8 @@
|
|||||||
|
|
||||||
import sys; sys.path.append ('@@PYTHONPATH@@')
|
import sys; sys.path.append ('@@PYTHONPATH@@')
|
||||||
import re, getopt
|
import re, getopt
|
||||||
import isc.auth
|
import isc.datasrc
|
||||||
from isc.auth.master import MasterFile
|
from isc.datasrc.master import MasterFile
|
||||||
|
|
||||||
#########################################################################
|
#########################################################################
|
||||||
# usage: print usage note and exit
|
# usage: print usage note and exit
|
||||||
@@ -71,10 +71,10 @@ def main():
|
|||||||
exit(1)
|
exit(1)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
isc.auth.sqlite3_ds.load(dbfile, zone, master.zonedata)
|
isc.datasrc.sqlite3_ds.load(dbfile, zone, master.zonedata)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print("Error loading database: " + str(e))
|
print("Error loading database: " + str(e))
|
||||||
exit(1)
|
exit(1)
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
main()
|
main(datasrc
|
||||||
|
@@ -165,8 +165,8 @@ class XfrinConnection(asyncore.dispatcher):
|
|||||||
if ret == XFRIN_OK:
|
if ret == XFRIN_OK:
|
||||||
self.log_msg(logstr + 'started')
|
self.log_msg(logstr + 'started')
|
||||||
self._send_query(rr_type.AXFR())
|
self._send_query(rr_type.AXFR())
|
||||||
isc.auth.sqlite3_ds.load(self._db_file, self._zone_name,
|
isc.datasrc.sqlite3_ds.load(self._db_file, self._zone_name,
|
||||||
self._handle_xfrin_response)
|
self._handle_xfrin_response)
|
||||||
|
|
||||||
self.log_msg(logstr + 'succeeded')
|
self.log_msg(logstr + 'succeeded')
|
||||||
|
|
||||||
@@ -174,7 +174,7 @@ class XfrinConnection(asyncore.dispatcher):
|
|||||||
self.log_msg(e)
|
self.log_msg(e)
|
||||||
self.log_msg(logstr + 'failed')
|
self.log_msg(logstr + 'failed')
|
||||||
#TODO, recover data source.
|
#TODO, recover data source.
|
||||||
except isc.auth.sqlite3_ds.Sqlite3DSError as e:
|
except isc.datasrc.sqlite3_ds.Sqlite3DSError as e:
|
||||||
self.log_msg(e)
|
self.log_msg(e)
|
||||||
self.log_msg(logstr + 'failed')
|
self.log_msg(logstr + 'failed')
|
||||||
finally:
|
finally:
|
||||||
|
@@ -22,7 +22,7 @@ import isc.cc
|
|||||||
import threading
|
import threading
|
||||||
import struct
|
import struct
|
||||||
import signal
|
import signal
|
||||||
from isc.auth import sqlite3_ds
|
from isc.datasrc import sqlite3_ds
|
||||||
from socketserver import *
|
from socketserver import *
|
||||||
import os
|
import os
|
||||||
from isc.config.ccsession import *
|
from isc.config.ccsession import *
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
SUBDIRS = exceptions dns cc config auth python
|
SUBDIRS = exceptions dns cc config datasrc python
|
||||||
if HAVE_BOOST_PYTHON
|
if HAVE_BOOST_PYTHON
|
||||||
if HAVE_BOOST_SYSTEM
|
if HAVE_BOOST_SYSTEM
|
||||||
SUBDIRS += xfr
|
SUBDIRS += xfr
|
||||||
|
@@ -1,13 +0,0 @@
|
|||||||
SUBDIRS = . tests
|
|
||||||
|
|
||||||
AM_CPPFLAGS = -I$(top_srcdir)/src/lib -I$(top_builddir)/src/lib
|
|
||||||
AM_CPPFLAGS += -I$(top_srcdir)/src/lib/dns -I$(top_builddir)/src/lib/dns
|
|
||||||
AM_CPPFLAGS += $(SQLITE_CFLAGS)
|
|
||||||
|
|
||||||
CLEANFILES = *.gcno *.gcda
|
|
||||||
|
|
||||||
lib_LTLIBRARIES = libauth.la
|
|
||||||
libauth_la_SOURCES = data_source.h data_source.cc
|
|
||||||
libauth_la_SOURCES += static_datasrc.h static_datasrc.cc
|
|
||||||
libauth_la_SOURCES += sqlite3_datasrc.h sqlite3_datasrc.cc
|
|
||||||
libauth_la_SOURCES += query.h query.cc
|
|
@@ -1,2 +0,0 @@
|
|||||||
- change filenames so we don't have everything starting with "data_source_"?
|
|
||||||
- store rdata in the database as binary blobs instead of text
|
|
13
src/lib/datasrc/Makefile.am
Normal file
13
src/lib/datasrc/Makefile.am
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
SUBDIRS = . tests
|
||||||
|
|
||||||
|
AM_CPPFLAGS = -I$(top_srcdir)/src/lib -I$(top_builddir)/src/lib
|
||||||
|
AM_CPPFLAGS += -I$(top_srcdir)/src/lib/dns -I$(top_builddir)/src/lib/dns
|
||||||
|
AM_CPPFLAGS += $(SQLITE_CFLAGS)
|
||||||
|
|
||||||
|
CLEANFILES = *.gcno *.gcda
|
||||||
|
|
||||||
|
lib_LTLIBRARIES = libdatasrc.la
|
||||||
|
libdatasrc_la_SOURCES = data_source.h data_source.cc
|
||||||
|
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
|
1
src/lib/datasrc/TODO
Normal file
1
src/lib/datasrc/TODO
Normal file
@@ -0,0 +1 @@
|
|||||||
|
- store rdata in the database as binary blobs instead of text
|
@@ -49,7 +49,7 @@ using namespace isc::dns;
|
|||||||
using namespace isc::dns::rdata;
|
using namespace isc::dns::rdata;
|
||||||
|
|
||||||
namespace isc {
|
namespace isc {
|
||||||
namespace auth {
|
namespace datasrc {
|
||||||
|
|
||||||
typedef boost::shared_ptr<const Nsec3Param> ConstNsec3ParamPtr;
|
typedef boost::shared_ptr<const Nsec3Param> ConstNsec3ParamPtr;
|
||||||
|
|
@@ -38,7 +38,7 @@ class RRset;
|
|||||||
class RRsetList;
|
class RRsetList;
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace auth {
|
namespace datasrc {
|
||||||
|
|
||||||
class NameMatch;
|
class NameMatch;
|
||||||
class Query;
|
class Query;
|
@@ -26,7 +26,7 @@
|
|||||||
using namespace isc::dns;
|
using namespace isc::dns;
|
||||||
|
|
||||||
namespace isc {
|
namespace isc {
|
||||||
namespace auth {
|
namespace datasrc {
|
||||||
|
|
||||||
QueryTask::QueryTask(const isc::dns::Name& n, const isc::dns::RRClass& c,
|
QueryTask::QueryTask(const isc::dns::Name& n, const isc::dns::RRClass& c,
|
||||||
const isc::dns::RRType& t, const isc::dns::Section& sect) :
|
const isc::dns::RRType& t, const isc::dns::Section& sect) :
|
@@ -28,7 +28,7 @@
|
|||||||
|
|
||||||
namespace isc {
|
namespace isc {
|
||||||
|
|
||||||
namespace auth {
|
namespace datasrc {
|
||||||
|
|
||||||
// An individual task to be carried out by the query logic
|
// An individual task to be carried out by the query logic
|
||||||
class QueryTask {
|
class QueryTask {
|
@@ -32,7 +32,7 @@ using namespace isc::dns;
|
|||||||
using namespace isc::dns::rdata;
|
using namespace isc::dns::rdata;
|
||||||
|
|
||||||
namespace isc {
|
namespace isc {
|
||||||
namespace auth {
|
namespace datasrc {
|
||||||
|
|
||||||
struct Sqlite3Parameters {
|
struct Sqlite3Parameters {
|
||||||
Sqlite3Parameters() : db_(NULL), version_(-1),
|
Sqlite3Parameters() : db_(NULL), version_(-1),
|
@@ -32,7 +32,7 @@ class RRType;
|
|||||||
class RRsetList;
|
class RRsetList;
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace auth {
|
namespace datasrc {
|
||||||
|
|
||||||
class Query;
|
class Query;
|
||||||
struct Sqlite3Parameters;
|
struct Sqlite3Parameters;
|
@@ -34,7 +34,7 @@ using namespace isc::dns;
|
|||||||
using namespace isc::dns::rdata;
|
using namespace isc::dns::rdata;
|
||||||
|
|
||||||
namespace isc {
|
namespace isc {
|
||||||
namespace auth {
|
namespace datasrc {
|
||||||
|
|
||||||
// This class stores the "static" data for the built-in static data source.
|
// This class stores the "static" data for the built-in static data source.
|
||||||
// Since it's static, it could be literally static, i.e, defined as static
|
// Since it's static, it could be literally static, i.e, defined as static
|
@@ -37,7 +37,7 @@ class RRType;
|
|||||||
class RRsetList;
|
class RRsetList;
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace auth {
|
namespace datasrc {
|
||||||
|
|
||||||
class Query;
|
class Query;
|
||||||
class NameMatch;
|
class NameMatch;
|
@@ -19,7 +19,7 @@ run_unittests_CPPFLAGS = $(AM_CPPFLAGS) $(GTEST_INCLUDES)
|
|||||||
run_unittests_LDFLAGS = $(AM_LDFLAGS) $(GTEST_LDFLAGS)
|
run_unittests_LDFLAGS = $(AM_LDFLAGS) $(GTEST_LDFLAGS)
|
||||||
run_unittests_LDADD = $(GTEST_LDADD)
|
run_unittests_LDADD = $(GTEST_LDADD)
|
||||||
run_unittests_LDADD += $(SQLITE_LIBS)
|
run_unittests_LDADD += $(SQLITE_LIBS)
|
||||||
run_unittests_LDADD += $(top_builddir)/src/lib/auth/.libs/libauth.a
|
run_unittests_LDADD += $(top_builddir)/src/lib/datasrc/.libs/libdatasrc.a
|
||||||
run_unittests_LDADD += $(top_builddir)/src/lib/dns/.libs/libdns.a
|
run_unittests_LDADD += $(top_builddir)/src/lib/dns/.libs/libdns.a
|
||||||
run_unittests_LDADD += $(top_builddir)/src/lib/cc/libcc.a
|
run_unittests_LDADD += $(top_builddir)/src/lib/cc/libcc.a
|
||||||
run_unittests_LDADD += $(top_builddir)/src/lib/exceptions/.libs/libexceptions.a
|
run_unittests_LDADD += $(top_builddir)/src/lib/exceptions/.libs/libexceptions.a
|
@@ -34,9 +34,9 @@
|
|||||||
|
|
||||||
#include <cc/data.h>
|
#include <cc/data.h>
|
||||||
|
|
||||||
#include <auth/query.h>
|
#include <datasrc/query.h>
|
||||||
#include <auth/sqlite3_datasrc.h>
|
#include <datasrc/sqlite3_datasrc.h>
|
||||||
#include <auth/static_datasrc.h>
|
#include <datasrc/static_datasrc.h>
|
||||||
|
|
||||||
#include <dns/tests/unittest_util.h>
|
#include <dns/tests/unittest_util.h>
|
||||||
#include "test_datasrc.h"
|
#include "test_datasrc.h"
|
||||||
@@ -45,7 +45,7 @@ using isc::UnitTestUtil;
|
|||||||
using namespace std;
|
using namespace std;
|
||||||
using namespace isc::dns;
|
using namespace isc::dns;
|
||||||
using namespace isc::dns::rdata;
|
using namespace isc::dns::rdata;
|
||||||
using namespace isc::auth;
|
using namespace isc::datasrc;
|
||||||
using namespace isc::data;
|
using namespace isc::data;
|
||||||
|
|
||||||
namespace {
|
namespace {
|
@@ -20,12 +20,12 @@
|
|||||||
#include <dns/rrtype.h>
|
#include <dns/rrtype.h>
|
||||||
#include <dns/rrclass.h>
|
#include <dns/rrclass.h>
|
||||||
|
|
||||||
#include <auth/query.h>
|
#include <datasrc/query.h>
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
using namespace isc::dns;
|
using namespace isc::dns;
|
||||||
using namespace isc::auth;
|
using namespace isc::datasrc;
|
||||||
|
|
||||||
|
|
||||||
class QueryTest : public ::testing::Test {
|
class QueryTest : public ::testing::Test {
|
@@ -32,14 +32,14 @@
|
|||||||
#include <dns/rrsetlist.h>
|
#include <dns/rrsetlist.h>
|
||||||
#include <cc/data.h>
|
#include <cc/data.h>
|
||||||
|
|
||||||
#include <auth/query.h>
|
#include <datasrc/query.h>
|
||||||
#include <auth/data_source.h>
|
#include <datasrc/data_source.h>
|
||||||
#include <auth/sqlite3_datasrc.h>
|
#include <datasrc/sqlite3_datasrc.h>
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
using namespace isc::dns;
|
using namespace isc::dns;
|
||||||
using namespace isc::dns::rdata;
|
using namespace isc::dns::rdata;
|
||||||
using namespace isc::auth;
|
using namespace isc::datasrc;
|
||||||
using namespace isc::data;
|
using namespace isc::data;
|
||||||
|
|
||||||
namespace {
|
namespace {
|
@@ -31,14 +31,14 @@
|
|||||||
#include <dns/rrsetlist.h>
|
#include <dns/rrsetlist.h>
|
||||||
#include <cc/data.h>
|
#include <cc/data.h>
|
||||||
|
|
||||||
#include <auth/query.h>
|
#include <datasrc/query.h>
|
||||||
#include <auth/data_source.h>
|
#include <datasrc/data_source.h>
|
||||||
#include <auth/static_datasrc.h>
|
#include <datasrc/static_datasrc.h>
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
using namespace isc::dns;
|
using namespace isc::dns;
|
||||||
using namespace isc::dns::rdata;
|
using namespace isc::dns::rdata;
|
||||||
using namespace isc::auth;
|
using namespace isc::datasrc;
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
class StaticDataSourceTest : public ::testing::Test {
|
class StaticDataSourceTest : public ::testing::Test {
|
@@ -21,7 +21,7 @@
|
|||||||
#include <dns/tests/unittest_util.h>
|
#include <dns/tests/unittest_util.h>
|
||||||
#include "test_datasrc.h"
|
#include "test_datasrc.h"
|
||||||
|
|
||||||
#include <auth/data_source.h>
|
#include <datasrc/data_source.h>
|
||||||
|
|
||||||
#include <dns/buffer.h>
|
#include <dns/buffer.h>
|
||||||
#include <dns/messagerenderer.h>
|
#include <dns/messagerenderer.h>
|
||||||
@@ -42,7 +42,7 @@ using namespace isc::dns;
|
|||||||
using namespace isc::dns::rdata;
|
using namespace isc::dns::rdata;
|
||||||
|
|
||||||
namespace isc {
|
namespace isc {
|
||||||
namespace auth {
|
namespace datasrc {
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
const Name example("example.com");
|
const Name example("example.com");
|
@@ -19,7 +19,7 @@
|
|||||||
|
|
||||||
#include <gtest/gtest.h>
|
#include <gtest/gtest.h>
|
||||||
|
|
||||||
#include <auth/data_source.h>
|
#include <datasrc/data_source.h>
|
||||||
|
|
||||||
namespace isc {
|
namespace isc {
|
||||||
|
|
||||||
@@ -30,7 +30,7 @@ class RRType;
|
|||||||
class RRsetList;
|
class RRsetList;
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace auth {
|
namespace datasrc {
|
||||||
class Query;
|
class Query;
|
||||||
|
|
||||||
class TestDataSrc : public DataSrc {
|
class TestDataSrc : public DataSrc {
|
@@ -1,4 +1,4 @@
|
|||||||
SUBDIRS = auth cc config # Util
|
SUBDIRS = datasrc cc config # Util
|
||||||
|
|
||||||
python_PYTHON = __init__.py
|
python_PYTHON = __init__.py
|
||||||
|
|
||||||
|
@@ -1,3 +1,3 @@
|
|||||||
import isc.auth
|
import isc.datasrc
|
||||||
import isc.cc
|
import isc.cc
|
||||||
import isc.config
|
import isc.config
|
||||||
|
@@ -1,2 +0,0 @@
|
|||||||
from isc.auth.master import *
|
|
||||||
from isc.auth.sqlite3_ds import *
|
|
@@ -1,3 +1,3 @@
|
|||||||
python_PYTHON = __init__.py master.py sqlite3_ds.py
|
python_PYTHON = __init__.py master.py sqlite3_ds.py
|
||||||
|
|
||||||
pythondir = $(pyexecdir)/isc/auth
|
pythondir = $(pyexecdir)/isc/datasrc
|
2
src/lib/python/isc/datasrc/__init__.py
Normal file
2
src/lib/python/isc/datasrc/__init__.py
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
from isc.datasrc.master import *
|
||||||
|
from isc.datasrc.sqlite3_ds import *
|
Reference in New Issue
Block a user