Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Kea
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Operations
Operations
Incidents
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Adam Osuchowski
Kea
Commits
53c1c6aa
Commit
53c1c6aa
authored
May 19, 2016
by
Razvan Becheriu
Committed by
Tomek Mrugalski
Jun 23, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added support for datastax cassandra
parent
f15c1a11
Changes
23
Show whitespace changes
Inline
Side-by-side
Showing
23 changed files
with
433 additions
and
7 deletions
+433
-7
configure.ac
configure.ac
+70
-0
src/bin/admin/admin-utils.sh
src/bin/admin/admin-utils.sh
+21
-0
src/bin/admin/kea-admin.in
src/bin/admin/kea-admin.in
+142
-3
src/bin/admin/tests/Makefile.am
src/bin/admin/tests/Makefile.am
+5
-1
src/bin/admin/tests/data/Makefile.am
src/bin/admin/tests/data/Makefile.am
+3
-1
src/bin/d2/Makefile.am
src/bin/d2/Makefile.am
+6
-0
src/bin/d2/d_controller.cc
src/bin/d2/d_controller.cc
+6
-0
src/bin/d2/tests/Makefile.am
src/bin/d2/tests/Makefile.am
+3
-0
src/bin/dhcp4/Makefile.am
src/bin/dhcp4/Makefile.am
+6
-0
src/bin/dhcp4/dhcp4_srv.cc
src/bin/dhcp4/dhcp4_srv.cc
+6
-0
src/bin/dhcp4/tests/Makefile.am
src/bin/dhcp4/tests/Makefile.am
+3
-0
src/bin/dhcp6/Makefile.am
src/bin/dhcp6/Makefile.am
+6
-0
src/bin/dhcp6/dhcp6_srv.cc
src/bin/dhcp6/dhcp6_srv.cc
+6
-0
src/bin/dhcp6/tests/Makefile.am
src/bin/dhcp6/tests/Makefile.am
+3
-0
src/bin/lfc/Makefile.am
src/bin/lfc/Makefile.am
+3
-0
src/bin/lfc/tests/Makefile.am
src/bin/lfc/tests/Makefile.am
+3
-0
src/lib/dhcpsrv/Makefile.am
src/lib/dhcpsrv/Makefile.am
+10
-0
src/lib/dhcpsrv/dhcpsrv_messages.mes
src/lib/dhcpsrv/dhcpsrv_messages.mes
+103
-0
src/lib/dhcpsrv/host_data_source_factory.cc
src/lib/dhcpsrv/host_data_source_factory.cc
+7
-0
src/lib/dhcpsrv/lease_mgr_factory.cc
src/lib/dhcpsrv/lease_mgr_factory.cc
+10
-0
src/lib/dhcpsrv/parsers/dbaccess_parser.cc
src/lib/dhcpsrv/parsers/dbaccess_parser.cc
+1
-1
src/lib/dhcpsrv/tests/Makefile.am
src/lib/dhcpsrv/tests/Makefile.am
+9
-0
src/share/database/scripts/Makefile.am
src/share/database/scripts/Makefile.am
+1
-1
No files found.
configure.ac
View file @
53c1c6aa
...
@@ -995,6 +995,58 @@ fi
...
@@ -995,6 +995,58 @@ fi
# ... and at the shell level, so Makefile.am can take action depending on this.
# ... and at the shell level, so Makefile.am can take action depending on this.
AM_CONDITIONAL(HAVE_PGSQL, test "$PG_CONFIG" != "")
AM_CONDITIONAL(HAVE_PGSQL, test "$PG_CONFIG" != "")
dsc_config="no"
AC_ARG_WITH([dhcp-dscsql],
AC_HELP_STRING([--with-dhcp-dscsql=PATH],
[path to the DataStaxCassandraSQL 'dsc_config' script]),
[dsc_config="$withval"])
if test "${dsc_config}" = "yes" ; then
DSC_CONFIG="/usr/bin/dsc_config"
elif test "${dsc_config}" != "no" ; then
DSC_CONFIG="${withval}"
fi
if test "$DSC_CONFIG" != "" ; then
if test -d "$DSC_CONFIG" -o ! -x "$DSC_CONFIG" ; then
AC_MSG_ERROR([--with-dhcp-dscsql should point to a dsc_config program])
fi
DSCSQL_CPPFLAGS=`$DSC_CONFIG --cppflags`
DSCSQL_INCLUDEDIR=`$DSC_CONFIG --includedir`
DSCSQL_CPPFLAGS="$DSCSQL_CPPFLAGS -I$DSCSQL_INCLUDEDIR"
DSCSQL_LIBS=`$DSC_CONFIG --libdir`
DSCSQL_LIBS="-L$DSCSQL_LIBS -lcassandra_static -luv"
DSCSQL_VERSION=`$DSC_CONFIG --version`
AC_SUBST(DSCSQL_CPPFLAGS)
AC_SUBST(DSCSQL_LIBS)
# Check that a simple program using DSCSQL functions can compile and link.
CPPFLAGS_SAVED="$CPPFLAGS"
LIBS_SAVED="$LIBS"
CPPFLAGS="$DSCSQL_CPPFLAGS $CPPFLAGS"
LIBS="$DSCSQL_LIBS $LIBS"
AC_LINK_IFELSE(
[AC_LANG_PROGRAM([#include <cassandra.h>],
[CassCluster* cluster = cass_cluster_new();
cass_cluster_free(cluster);])],
[AC_MSG_RESULT([checking for DataStax Cassandra SQL headers and library... yes])],
[AC_MSG_RESULT([checking for DataStax Cassandra SQL headers and library... no])
AC_MSG_ERROR([Needs DataStax Cassandra SQL library])]
)
CPPFLAGS=$CPPFLAGS_SAVED
LIBS=$LIBS_SAVED
# Note that DSCSQL is present in the config.h file
AC_DEFINE([HAVE_DSCSQL], [1], [DSCSQL is present])
fi
# ... and at the shell level, so Makefile.am can take action depending on this.
AM_CONDITIONAL(HAVE_DSCSQL, test "$DSC_CONFIG" != "")
# Check for log4cplus
# Check for log4cplus
log4cplus_path="yes"
log4cplus_path="yes"
AC_ARG_WITH([log4cplus],
AC_ARG_WITH([log4cplus],
...
@@ -1409,6 +1461,7 @@ AC_CONFIG_FILES([compatcheck/Makefile
...
@@ -1409,6 +1461,7 @@ AC_CONFIG_FILES([compatcheck/Makefile
src/bin/admin/tests/memfile_tests.sh
src/bin/admin/tests/memfile_tests.sh
src/bin/admin/tests/mysql_tests.sh
src/bin/admin/tests/mysql_tests.sh
src/bin/admin/tests/pgsql_tests.sh
src/bin/admin/tests/pgsql_tests.sh
src/bin/admin/tests/dscsql_tests.sh
src/hooks/Makefile
src/hooks/Makefile
src/hooks/dhcp/Makefile
src/hooks/dhcp/Makefile
src/hooks/dhcp/user_chk/Makefile
src/hooks/dhcp/user_chk/Makefile
...
@@ -1486,6 +1539,7 @@ AC_CONFIG_FILES([compatcheck/Makefile
...
@@ -1486,6 +1539,7 @@ AC_CONFIG_FILES([compatcheck/Makefile
src/share/database/scripts/pgsql/Makefile
src/share/database/scripts/pgsql/Makefile
src/share/database/scripts/pgsql/upgrade_1.0_to_2.0.sh
src/share/database/scripts/pgsql/upgrade_1.0_to_2.0.sh
src/share/database/scripts/pgsql/upgrade_2.0_to_3.0.sh
src/share/database/scripts/pgsql/upgrade_2.0_to_3.0.sh
src/share/database/scripts/dscsql/Makefile
tools/Makefile
tools/Makefile
tools/path_replacer.sh
tools/path_replacer.sh
])
])
...
@@ -1619,6 +1673,22 @@ PostgreSQL:
...
@@ -1619,6 +1673,22 @@ PostgreSQL:
END
END
fi
fi
if test "$DSCSQL_CPPFLAGS" != "" ; then
cat >> config.report << END
DataStax Cassandra SQL:
DSCSQL_VERSION: ${DSCSQL_VERSION}
DSCSQL_CPPFLAGS: ${DSCSQL_CPPFLAGS}
DSCSQL_LIBS: ${DSCSQL_LIBS}
END
else
cat >> config.report << END
DataStax Cassandra SQL:
no
END
fi
if test "$enable_gtest" != "no"; then
if test "$enable_gtest" != "no"; then
cat >> config.report << END
cat >> config.report << END
...
...
src/bin/admin/admin-utils.sh
View file @
53c1c6aa
...
@@ -86,3 +86,24 @@ pgsql_version() {
...
@@ -86,3 +86,24 @@ pgsql_version() {
pgsql_execute
"SELECT version || '.' || minor FROM schema_version"
"
$@
"
pgsql_execute
"SELECT version || '.' || minor FROM schema_version"
"
$@
"
return
$?
return
$?
}
}
dscsql_execute
()
{
QUERY
=
$1
shift
if
[
$#
-gt
1
]
;
then
cqlsh
$*
-e
"
${
QUERY
}
"
retcode
=
$?
else
cqlsh
-u
$db_user
-p
$db_password
-e
"
${
QUERY
}
"
-k
$db_name
retcode
=
"
$?
"
fi
return
$retcode
}
dscsql_version
()
{
version
=
`
dscsql_execute
"SELECT version, minor FROM schema_version"
"
$@
"
`
version
=
`
echo
"
$version
"
|
grep
-A
1
"+"
|
grep
-v
"+"
|
tr
-d
' '
|
cut
-d
"|"
-f
1-2
--output-delimiter
=
"."
`
echo
$version
return
$?
}
src/bin/admin/kea-admin.in
View file @
53c1c6aa
...
@@ -55,7 +55,7 @@ usage() {
...
@@ -55,7 +55,7 @@ usage() {
printf
" - lease-upgrade: Upgrades your lease database scheme
\n
"
printf
" - lease-upgrade: Upgrades your lease database scheme
\n
"
printf
" - lease-dump: Dump current leases to a CSV file
\n
"
printf
" - lease-dump: Dump current leases to a CSV file
\n
"
printf
"
\n
"
printf
"
\n
"
printf
"BACKEND - one of the supported backends: memfile|mysql|pgsql
\n
"
printf
"BACKEND - one of the supported backends: memfile|mysql|pgsql
|dscsql
\n
"
printf
"
\n
"
printf
"
\n
"
printf
"PARAMETERS: Parameters are optional in general, but may be required
\n
"
printf
"PARAMETERS: Parameters are optional in general, but may be required
\n
"
printf
" for specific operation.
\n
"
printf
" for specific operation.
\n
"
...
@@ -148,7 +148,7 @@ mysql_init() {
...
@@ -148,7 +148,7 @@ mysql_init() {
if
[
$COUNT
-gt
0
]
;
then
if
[
$COUNT
-gt
0
]
;
then
# Let't start with a new line. mysql could have printed something out.
# Let't start with a new line. mysql could have printed something out.
printf
"
\n
"
printf
"
\n
"
log_error
"Expected empty database
$db_name
, but there are
$COUNT
tables:
\n
$
_
RESULT
. Aborting."
log_error
"Expected empty database
$db_name
, but there are
$COUNT
tables:
\n
$RESULT
. Aborting."
exit
1
exit
1
fi
fi
...
@@ -200,6 +200,47 @@ pgsql_init() {
...
@@ -200,6 +200,47 @@ pgsql_init() {
exit
0
exit
0
}
}
dscsql_init
()
{
printf
"Checking if there is a database initialized already. Please ignore errors.
\n
"
# Let's try to count the number of tables. Anything above 0 means that there
# is some database in place. If there is anything, we abort. Note that
# dsc sql may spit out connection or access errors to stderr, we ignore those.
# We should not hide them as they may give hints to user what is wrong with
# his setup.
#
RESULT
=
`
echo
"DESCRIBE keyspaces;"
| cqlsh
`
ERRCODE
=
$?
if
[
$ERRCODE
-ne
0
]
then
log_error
"dscsql_init table query failed, cqlsh status =
$ERRCODE
"
exit
1
fi
COUNT
=
`
echo
$RESULT
|
grep
$db_name
|
wc
-w
`
if
[
$COUNT
-gt
0
]
;
then
# Let't start with a new line. cqlsh could have printed something out.
printf
"
\n
"
log_error
"Expected empty database
$db_name
, but there are
$COUNT
tables:
\n
$RESULT
. Aborting."
exit
1
fi
printf
"Initializing database using script %s
\n
"
$scripts_dir
/dscsql/dhcpdb_create.cql
cqlsh
-u
$db_user
-p
$db_password
-e
"CREATE KEYSPACE
$db_name
WITH replication = {'class' : 'SimpleStrategy','replication_factor' : 1};"
cqlsh
-u
$db_user
-p
$db_password
-k
$db_name
-f
$scripts_dir
/dscsql/dhcpdb_create.cql
ERRCODE
=
$?
printf
"cqlsh returned status code
$ERRCODE
\n
"
if
[
"
$ERRCODE
"
-eq
0
]
;
then
printf
"Lease DB version reported after initialization: "
dscsql_version
printf
"
\n
"
fi
exit
$ERRCODE
}
### Functions that implement database version checking commands
### Functions that implement database version checking commands
memfile_version
()
{
memfile_version
()
{
# @todo Implement this as part of #3601
# @todo Implement this as part of #3601
...
@@ -282,6 +323,34 @@ pgsql_upgrade() {
...
@@ -282,6 +323,34 @@ pgsql_upgrade() {
exit
0
exit
0
}
}
dscsql_upgrade
()
{
version
=
`
dscsql_version
`
printf
"Lease DB version reported before upgrade:
$version
\n
"
# Check if the scripts directory exists at all.
if
[
!
-d
${
scripts_dir
}
/dscsql
]
;
then
log_error
"Invalid scripts directory:
${
scripts_dir
}
/dscsql"
exit
1
fi
# Check if there are any files in it
num_files
=
$(
find
${
scripts_dir
}
/dscsql/upgrade
*
.sh
-type
f |
wc
-l
)
if
[
$num_files
-eq
0
]
;
then
log_error
"No scripts in
${
scripts_dir
}
/dscsql or the directory is not readable or does not have any upgrade* scripts."
exit
1
fi
for
script
in
${
scripts_dir
}
/dscsql/upgrade
*
.sh
do
echo
"Processing
$script
file..."
sh
${
script
}
-u
${
db_user
}
-p
${
db_password
}
-k
${
db_name
}
done
version
=
`
dscsql_version
`
printf
"Lease DB version reported after upgrade:
$version
\n
"
exit
0
}
# Utility function which tests if the given file exists and
# Utility function which tests if the given file exists and
# if so notifies the user and provides them the opportunity
# if so notifies the user and provides them the opportunity
# to abort the current command.
# to abort the current command.
...
@@ -315,6 +384,9 @@ get_dump_query() {
...
@@ -315,6 +384,9 @@ get_dump_query() {
pgsql
)
pgsql
)
invoke
=
"select * from"
invoke
=
"select * from"
;;
;;
dscsql
)
invoke
=
"select * from"
;;
*
)
*
)
log_error
"unsupported backend
${
backend
}
"
log_error
"unsupported backend
${
backend
}
"
usage
usage
...
@@ -419,6 +491,61 @@ pgsql_dump() {
...
@@ -419,6 +491,61 @@ pgsql_dump() {
exit
0
exit
0
}
}
dscsql_dump
()
{
# get the correct dump query
version
=
`
dscsql_version
`
retcode
=
$?
if
[
$retcode
-ne
0
]
then
log_error
"lease-dump: dscsql_version failed, exit code
$retcode
"
exit
1
;
fi
# Fetch the correct SQL text. Note this function will exit
# if it fails.
get_dump_query
$version
# Make sure they specified a file
if
[
"
$dump_file
"
=
""
]
;
then
log_error
"you must specify an output file for lease-dump"
usage
exit
1
fi
# If output file exists, notify user, allow them a chance to bail
check_file_overwrite
$dump_file
# Check the temp file too
tmp_file
=
"
$dump_file
.tmp"
check_file_overwrite
$tmp_file
# Run the sql to output tab-delimited lease data to a temp file.
# By using a temp file we can check for MySQL errors before using
# 'tr' to translate tabs to commas. We do not use MySQL's output
# to file as that requires linux superuser privileges to execute
# the select.
dscsql_execute
"
${
dump_qry
}
"
>
$tmp_file
retcode
=
$?
if
[
$retcode
-ne
0
]
;
then
log_error
"lease-dump: dscsql_execute failed, exit code
$retcode
"
;
exit
1
fi
# Now translate tabs to commas.
cat
$tmp_file
|
tr
'\t'
','
>
$dump_file
if
[
$?
-ne
0
]
;
then
log_error
"lease-dump: reformatting failed"
;
exit
1
fi
# delete the tmp file on success
rm
$tmp_file
echo
lease
$dump_type
successfully dumped to
$dump_file
exit
0
}
### Script starts here ###
### Script starts here ###
# First, find what the command is
# First, find what the command is
...
@@ -442,7 +569,7 @@ if [ -z ${backend} ]; then
...
@@ -442,7 +569,7 @@ if [ -z ${backend} ]; then
usage
usage
exit
1
exit
1
fi
fi
is_in_list
"
${
backend
}
"
"memfile mysql pgsql"
is_in_list
"
${
backend
}
"
"memfile mysql pgsql
dscsql
"
if
[
${
_inlist
}
-eq
0
]
;
then
if
[
${
_inlist
}
-eq
0
]
;
then
log_error
"invalid backend:
${
backend
}
"
log_error
"invalid backend:
${
backend
}
"
exit
1
exit
1
...
@@ -542,6 +669,9 @@ case ${command} in
...
@@ -542,6 +669,9 @@ case ${command} in
pgsql
)
pgsql
)
pgsql_init
pgsql_init
;;
;;
dscsql
)
dscsql_init
;;
esac
esac
;;
;;
lease-version
)
lease-version
)
...
@@ -556,6 +686,9 @@ case ${command} in
...
@@ -556,6 +686,9 @@ case ${command} in
pgsql
)
pgsql
)
pgsql_version
pgsql_version
;;
;;
dscsql
)
dscsql_version
;;
esac
esac
;;
;;
lease-upgrade
)
lease-upgrade
)
...
@@ -569,6 +702,9 @@ case ${command} in
...
@@ -569,6 +702,9 @@ case ${command} in
pgsql
)
pgsql
)
pgsql_upgrade
pgsql_upgrade
;;
;;
dscsql
)
dscsql_upgrade
;;
esac
esac
;;
;;
lease-dump
)
lease-dump
)
...
@@ -582,6 +718,9 @@ case ${command} in
...
@@ -582,6 +718,9 @@ case ${command} in
pgsql
)
pgsql
)
pgsql_dump
pgsql_dump
;;
;;
dscsql
)
dscsql_dump
;;
esac
esac
;;
;;
esac
esac
...
...
src/bin/admin/tests/Makefile.am
View file @
53c1c6aa
...
@@ -10,13 +10,17 @@ if HAVE_PGSQL
...
@@ -10,13 +10,17 @@ if HAVE_PGSQL
SHTESTS
+=
pgsql_tests.sh
SHTESTS
+=
pgsql_tests.sh
endif
endif
if
HAVE_DSCSQL
SHTESTS
+=
dscsql_tests.sh
endif
noinst_SCRIPTS
=
$(SHTESTS)
noinst_SCRIPTS
=
$(SHTESTS)
EXTRA_DIST
=
dhcpdb_create_1.0.mysql
EXTRA_DIST
=
dhcpdb_create_1.0.mysql
EXTRA_DIST
+=
dhcpdb_create_1.0.pgsql
EXTRA_DIST
+=
dhcpdb_create_1.0.pgsql
EXTRA_DIST
+=
dhcpdb_create_1.0.cql
CLEANFILES
=
*
.log
CLEANFILES
=
*
.log
DISTCLEANFILES
=
memfile_tests.sh mysql_tests.sh pgsql_tests.sh
DISTCLEANFILES
=
memfile_tests.sh mysql_tests.sh pgsql_tests.sh
dscsql_tests.sh
# Execute all test scripts.
# Execute all test scripts.
check-local
:
check-local
:
...
...
src/bin/admin/tests/data/Makefile.am
View file @
53c1c6aa
EXTRA_DIST
=
mysql.lease4_dump_test.reference.csv
\
EXTRA_DIST
=
mysql.lease4_dump_test.reference.csv
\
mysql.lease6_dump_test.reference.csv
\
mysql.lease6_dump_test.reference.csv
\
pgsql.lease4_dump_test.reference.csv
\
pgsql.lease4_dump_test.reference.csv
\
pgsql.lease6_dump_test.reference.csv
pgsql.lease6_dump_test.reference.csv
\
dscsql.lease4_dump_test.reference.csv
\
dscsql.lease6_dump_test.reference.csv
src/bin/d2/Makefile.am
View file @
53c1c6aa
...
@@ -9,6 +9,9 @@ endif
...
@@ -9,6 +9,9 @@ endif
if
HAVE_PGSQL
if
HAVE_PGSQL
AM_CPPFLAGS
+=
$(PGSQL_CPPFLAGS)
AM_CPPFLAGS
+=
$(PGSQL_CPPFLAGS)
endif
endif
if
HAVE_DSCSQL
AM_CPPFLAGS
+=
$(DSCSQL_CPPFLAGS)
endif
AM_CXXFLAGS
=
$(KEA_CXXFLAGS)
AM_CXXFLAGS
=
$(KEA_CXXFLAGS)
if
USE_CLANGPP
if
USE_CLANGPP
...
@@ -119,6 +122,9 @@ endif
...
@@ -119,6 +122,9 @@ endif
if
HAVE_PGSQL
if
HAVE_PGSQL
kea_dhcp_ddns_LDFLAGS
+=
$(PGSQL_LIBS)
kea_dhcp_ddns_LDFLAGS
+=
$(PGSQL_LIBS)
endif
endif
if
HAVE_DSCSQL
kea_dhcp_ddns_LDFLAGS
+=
$(DSCSQL_LIBS)
endif
kea_dhcp_ddnsdir
=
$(pkgdatadir)
kea_dhcp_ddnsdir
=
$(pkgdatadir)
kea_dhcp_ddns_DATA
=
dhcp-ddns.spec
kea_dhcp_ddns_DATA
=
dhcp-ddns.spec
src/bin/d2/d_controller.cc
View file @
53c1c6aa
...
@@ -21,6 +21,9 @@
...
@@ -21,6 +21,9 @@
#ifdef HAVE_PGSQL
#ifdef HAVE_PGSQL
#include <dhcpsrv/pgsql_lease_mgr.h>
#include <dhcpsrv/pgsql_lease_mgr.h>
#endif
#endif
#ifdef HAVE_DSCSQL
#include <dhcpsrv/dscsql_lease_mgr.h>
#endif
#include <dhcpsrv/memfile_lease_mgr.h>
#include <dhcpsrv/memfile_lease_mgr.h>
#include <sstream>
#include <sstream>
...
@@ -484,6 +487,9 @@ DControllerBase::getVersion(bool extended) {
...
@@ -484,6 +487,9 @@ DControllerBase::getVersion(bool extended) {
#endif
#endif
#ifdef HAVE_PGSQL
#ifdef HAVE_PGSQL
tmp
<<
isc
::
dhcp
::
PgSqlLeaseMgr
::
getDBVersion
()
<<
std
::
endl
;
tmp
<<
isc
::
dhcp
::
PgSqlLeaseMgr
::
getDBVersion
()
<<
std
::
endl
;
#endif
#ifdef HAVE_DSCSQL
tmp
<<
isc
::
dhcp
::
DSCSqlLeaseMgr
::
getDBVersion
()
<<
std
::
endl
;
#endif
#endif
tmp
<<
isc
::
dhcp
::
Memfile_LeaseMgr
::
getDBVersion
();
tmp
<<
isc
::
dhcp
::
Memfile_LeaseMgr
::
getDBVersion
();
...
...
src/bin/d2/tests/Makefile.am
View file @
53c1c6aa
...
@@ -75,6 +75,9 @@ endif
...
@@ -75,6 +75,9 @@ endif
if
HAVE_PGSQL
if
HAVE_PGSQL
d2_unittests_LDFLAGS
+=
$(PGSQL_LIBS)
d2_unittests_LDFLAGS
+=
$(PGSQL_LIBS)
endif
endif
if
HAVE_DSCSQL
d2_unittests_LDFLAGS
+=
$(DSCSQL_LIBS)
endif
d2_unittests_LDFLAGS
+=
$(GTEST_LDFLAGS)
d2_unittests_LDFLAGS
+=
$(GTEST_LDFLAGS)
d2_unittests_LDADD
=
$(top_builddir)
/src/bin/d2/libd2.la
d2_unittests_LDADD
=
$(top_builddir)
/src/bin/d2/libd2.la
...
...
src/bin/dhcp4/Makefile.am
View file @
53c1c6aa
...
@@ -10,6 +10,9 @@ endif
...
@@ -10,6 +10,9 @@ endif
if
HAVE_PGSQL
if
HAVE_PGSQL
AM_CPPFLAGS
+=
$(PGSQL_CPPFLAGS)
AM_CPPFLAGS
+=
$(PGSQL_CPPFLAGS)
endif
endif
if
HAVE_DSCSQL
AM_CPPFLAGS
+=
$(DSCSQL_CPPFLAGS)
endif
AM_CXXFLAGS
=
$(KEA_CXXFLAGS)
AM_CXXFLAGS
=
$(KEA_CXXFLAGS)
if
USE_CLANGPP
if
USE_CLANGPP
...
@@ -99,6 +102,9 @@ endif
...
@@ -99,6 +102,9 @@ endif
if
HAVE_PGSQL
if
HAVE_PGSQL
kea_dhcp4_LDFLAGS
+=
$(PGSQL_LIBS)
kea_dhcp4_LDFLAGS
+=
$(PGSQL_LIBS)
endif
endif
if
HAVE_DSCSQL
kea_dhcp4_LDFLAGS
+=
$(DSCSQL_LIBS)
endif
kea_dhcp4dir
=
$(pkgdatadir)
kea_dhcp4dir
=
$(pkgdatadir)
kea_dhcp4_DATA
=
dhcp4.spec
kea_dhcp4_DATA
=
dhcp4.spec
src/bin/dhcp4/dhcp4_srv.cc
View file @
53c1c6aa
...
@@ -49,6 +49,9 @@
...
@@ -49,6 +49,9 @@
#ifdef HAVE_PGSQL
#ifdef HAVE_PGSQL
#include <dhcpsrv/pgsql_lease_mgr.h>
#include <dhcpsrv/pgsql_lease_mgr.h>
#endif
#endif
#ifdef HAVE_DSCSQL
#include <dhcpsrv/dscsql_lease_mgr.h>
#endif
#include <dhcpsrv/memfile_lease_mgr.h>
#include <dhcpsrv/memfile_lease_mgr.h>
#include <boost/bind.hpp>
#include <boost/bind.hpp>
...
@@ -2534,6 +2537,9 @@ Dhcpv4Srv::getVersion(bool extended) {
...
@@ -2534,6 +2537,9 @@ Dhcpv4Srv::getVersion(bool extended) {
#endif
#endif
#ifdef HAVE_PGSQL
#ifdef HAVE_PGSQL
tmp
<<
PgSqlLeaseMgr
::
getDBVersion
()
<<
endl
;
tmp
<<
PgSqlLeaseMgr
::
getDBVersion
()
<<
endl
;
#endif
#ifdef HAVE_DSCSQL
tmp
<<
DSCSqlLeaseMgr
::
getDBVersion
()
<<
endl
;
#endif
#endif
tmp
<<
Memfile_LeaseMgr
::
getDBVersion
();
tmp
<<
Memfile_LeaseMgr
::
getDBVersion
();
...
...
src/bin/dhcp4/tests/Makefile.am
View file @
53c1c6aa
...
@@ -106,6 +106,9 @@ endif
...
@@ -106,6 +106,9 @@ endif
if
HAVE_PGSQL
if
HAVE_PGSQL
dhcp4_unittests_LDFLAGS
+=
$(PGSQL_LIBS)
dhcp4_unittests_LDFLAGS
+=
$(PGSQL_LIBS)
endif
endif
if
HAVE_DSCSQL
dhcp4_unittests_LDFLAGS
+=
$(DSCSQL_LIBS)
endif
dhcp4_unittests_LDFLAGS
+=
$(GTEST_LDFLAGS)
dhcp4_unittests_LDFLAGS
+=
$(GTEST_LDFLAGS)
dhcp4_unittests_LDADD
=
$(top_builddir)
/src/bin/dhcp4/libdhcp4.la
dhcp4_unittests_LDADD
=
$(top_builddir)
/src/bin/dhcp4/libdhcp4.la
...
...
src/bin/dhcp6/Makefile.am
View file @
53c1c6aa
...
@@ -10,6 +10,9 @@ endif
...
@@ -10,6 +10,9 @@ endif
if
HAVE_PGSQL
if
HAVE_PGSQL
AM_CPPFLAGS
+=
$(PGSQL_CPPFLAGS)
AM_CPPFLAGS
+=
$(PGSQL_CPPFLAGS)
endif
endif
if
HAVE_DSCSQL
AM_CPPFLAGS
+=
$(DSCSQL_CPPFLAGS)
endif
AM_CXXFLAGS
=
$(KEA_CXXFLAGS)
AM_CXXFLAGS
=
$(KEA_CXXFLAGS)
if
USE_CLANGPP
if
USE_CLANGPP
...
@@ -100,6 +103,9 @@ endif
...
@@ -100,6 +103,9 @@ endif
if
HAVE_PGSQL
if
HAVE_PGSQL
kea_dhcp6_LDFLAGS
+=
$(PGSQL_LIBS)
kea_dhcp6_LDFLAGS
+=
$(PGSQL_LIBS)
endif
endif
if
HAVE_DSCSQL
kea_dhcp6_LDFLAGS
+=
$(DSCSQL_LIBS)
endif
kea_dhcp6dir
=
$(pkgdatadir)
kea_dhcp6dir
=
$(pkgdatadir)
kea_dhcp6_DATA
=
dhcp6.spec
kea_dhcp6_DATA
=
dhcp6.spec
src/bin/dhcp6/dhcp6_srv.cc
View file @
53c1c6aa
...
@@ -58,6 +58,9 @@
...
@@ -58,6 +58,9 @@
#ifdef HAVE_PGSQL
#ifdef HAVE_PGSQL
#include <dhcpsrv/pgsql_lease_mgr.h>
#include <dhcpsrv/pgsql_lease_mgr.h>
#endif
#endif
#ifdef HAVE_DSCSQL
#include <dhcpsrv/dscsql_lease_mgr.h>
#endif
#include <dhcpsrv/memfile_lease_mgr.h>
#include <dhcpsrv/memfile_lease_mgr.h>
#include <boost/bind.hpp>
#include <boost/bind.hpp>
...
@@ -2982,6 +2985,9 @@ Dhcpv6Srv::getVersion(bool extended) {
...
@@ -2982,6 +2985,9 @@ Dhcpv6Srv::getVersion(bool extended) {
#endif
#endif
#ifdef HAVE_PGSQL
#ifdef HAVE_PGSQL
tmp
<<
PgSqlLeaseMgr
::
getDBVersion
()
<<
endl
;
tmp
<<
PgSqlLeaseMgr
::
getDBVersion
()
<<
endl
;
#endif
#ifdef HAVE_DSCSQL
tmp
<<
DSCSqlLeaseMgr
::
getDBVersion
()
<<
endl
;
#endif
#endif
tmp
<<
Memfile_LeaseMgr
::
getDBVersion
();
tmp
<<
Memfile_LeaseMgr
::
getDBVersion
();