summaryrefslogtreecommitdiffstats
path: root/src/hooks/dhcp/stat_cmds
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-13 12:15:43 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-13 12:15:43 +0000
commitf5f56e1a1c4d9e9496fcb9d81131066a964ccd23 (patch)
tree49e44c6f87febed37efb953ab5485aa49f6481a7 /src/hooks/dhcp/stat_cmds
parentInitial commit. (diff)
downloadisc-kea-f5f56e1a1c4d9e9496fcb9d81131066a964ccd23.tar.xz
isc-kea-f5f56e1a1c4d9e9496fcb9d81131066a964ccd23.zip
Adding upstream version 2.4.1.upstream/2.4.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/hooks/dhcp/stat_cmds')
-rw-r--r--src/hooks/dhcp/stat_cmds/Makefile.am87
-rw-r--r--src/hooks/dhcp/stat_cmds/Makefile.in1064
-rw-r--r--src/hooks/dhcp/stat_cmds/libloadtests/Makefile.am55
-rw-r--r--src/hooks/dhcp/stat_cmds/libloadtests/Makefile.in1030
-rw-r--r--src/hooks/dhcp/stat_cmds/libloadtests/load_unload_unittests.cc64
-rw-r--r--src/hooks/dhcp/stat_cmds/libloadtests/run_unittests.cc20
-rw-r--r--src/hooks/dhcp/stat_cmds/stat_cmds.cc769
-rw-r--r--src/hooks/dhcp/stat_cmds/stat_cmds.dox207
-rw-r--r--src/hooks/dhcp/stat_cmds/stat_cmds.h124
-rw-r--r--src/hooks/dhcp/stat_cmds/stat_cmds_callouts.cc90
-rw-r--r--src/hooks/dhcp/stat_cmds/stat_cmds_log.cc18
-rw-r--r--src/hooks/dhcp/stat_cmds/stat_cmds_log.h23
-rw-r--r--src/hooks/dhcp/stat_cmds/stat_cmds_messages.cc49
-rw-r--r--src/hooks/dhcp/stat_cmds/stat_cmds_messages.h25
-rw-r--r--src/hooks/dhcp/stat_cmds/stat_cmds_messages.mes81
-rw-r--r--src/hooks/dhcp/stat_cmds/tests/Makefile.am75
-rw-r--r--src/hooks/dhcp/stat_cmds/tests/Makefile.in1043
-rw-r--r--src/hooks/dhcp/stat_cmds/tests/run_unittests.cc19
-rw-r--r--src/hooks/dhcp/stat_cmds/tests/stat_cmds_unittest.cc1605
-rw-r--r--src/hooks/dhcp/stat_cmds/version.cc17
20 files changed, 6465 insertions, 0 deletions
diff --git a/src/hooks/dhcp/stat_cmds/Makefile.am b/src/hooks/dhcp/stat_cmds/Makefile.am
new file mode 100644
index 0000000..b66ef06
--- /dev/null
+++ b/src/hooks/dhcp/stat_cmds/Makefile.am
@@ -0,0 +1,87 @@
+SUBDIRS = . tests libloadtests
+
+AM_CPPFLAGS = -I$(top_builddir)/src/lib -I$(top_srcdir)/src/lib
+AM_CPPFLAGS += $(BOOST_INCLUDES)
+AM_CXXFLAGS = $(KEA_CXXFLAGS)
+
+# Ensure that the message file and doxygen file is included in the distribution
+EXTRA_DIST = stat_cmds_messages.mes
+EXTRA_DIST += stat_cmds.dox
+
+CLEANFILES = *.gcno *.gcda
+
+# convenience archive
+
+noinst_LTLIBRARIES = libstat_cmds.la
+
+libstat_cmds_la_SOURCES = stat_cmds.cc stat_cmds.h
+libstat_cmds_la_SOURCES += stat_cmds_callouts.cc
+libstat_cmds_la_SOURCES += stat_cmds_log.cc stat_cmds_log.h
+libstat_cmds_la_SOURCES += stat_cmds_messages.cc stat_cmds_messages.h
+libstat_cmds_la_SOURCES += version.cc
+
+libstat_cmds_la_CXXFLAGS = $(AM_CXXFLAGS)
+libstat_cmds_la_CPPFLAGS = $(AM_CPPFLAGS)
+
+# install the shared object into $(libdir)/kea/hooks
+lib_hooksdir = $(libdir)/kea/hooks
+lib_hooks_LTLIBRARIES = libdhcp_stat_cmds.la
+
+libdhcp_stat_cmds_la_SOURCES =
+libdhcp_stat_cmds_la_LDFLAGS = $(AM_LDFLAGS)
+libdhcp_stat_cmds_la_LDFLAGS += -avoid-version -export-dynamic -module
+libdhcp_stat_cmds_la_LIBADD = libstat_cmds.la
+libdhcp_stat_cmds_la_LIBADD += $(top_builddir)/src/lib/dhcpsrv/libkea-dhcpsrv.la
+libdhcp_stat_cmds_la_LIBADD += $(top_builddir)/src/lib/process/libkea-process.la
+libdhcp_stat_cmds_la_LIBADD += $(top_builddir)/src/lib/eval/libkea-eval.la
+libdhcp_stat_cmds_la_LIBADD += $(top_builddir)/src/lib/dhcp_ddns/libkea-dhcp_ddns.la
+libdhcp_stat_cmds_la_LIBADD += $(top_builddir)/src/lib/stats/libkea-stats.la
+libdhcp_stat_cmds_la_LIBADD += $(top_builddir)/src/lib/config/libkea-cfgclient.la
+libdhcp_stat_cmds_la_LIBADD += $(top_builddir)/src/lib/http/libkea-http.la
+libdhcp_stat_cmds_la_LIBADD += $(top_builddir)/src/lib/dhcp/libkea-dhcp++.la
+libdhcp_stat_cmds_la_LIBADD += $(top_builddir)/src/lib/hooks/libkea-hooks.la
+libdhcp_stat_cmds_la_LIBADD += $(top_builddir)/src/lib/database/libkea-database.la
+libdhcp_stat_cmds_la_LIBADD += $(top_builddir)/src/lib/cc/libkea-cc.la
+libdhcp_stat_cmds_la_LIBADD += $(top_builddir)/src/lib/asiolink/libkea-asiolink.la
+libdhcp_stat_cmds_la_LIBADD += $(top_builddir)/src/lib/dns/libkea-dns++.la
+libdhcp_stat_cmds_la_LIBADD += $(top_builddir)/src/lib/cryptolink/libkea-cryptolink.la
+libdhcp_stat_cmds_la_LIBADD += $(top_builddir)/src/lib/log/libkea-log.la
+libdhcp_stat_cmds_la_LIBADD += $(top_builddir)/src/lib/util/libkea-util.la
+libdhcp_stat_cmds_la_LIBADD += $(top_builddir)/src/lib/exceptions/libkea-exceptions.la
+libdhcp_stat_cmds_la_LIBADD += $(LOG4CPLUS_LIBS)
+libdhcp_stat_cmds_la_LIBADD += $(CRYPTO_LIBS)
+libdhcp_stat_cmds_la_LIBADD += $(BOOST_LIBS)
+
+# If we want to get rid of all generated messages files, we need to use
+# make maintainer-clean. The proper way to introduce custom commands for
+# that operation is to define maintainer-clean-local target. However,
+# make maintainer-clean also removes Makefile, so running configure script
+# is required. To make it easy to rebuild messages without going through
+# reconfigure, a new target messages-clean has been added.
+maintainer-clean-local:
+ rm -f stat_cmds_messages.h stat_cmds_messages.cc
+
+# To regenerate messages files, one can do:
+#
+# make messages-clean
+# make messages
+#
+# This is needed only when a .mes file is modified.
+messages-clean: maintainer-clean-local
+
+if GENERATE_MESSAGES
+
+# Define rule to build logging source files from message file
+messages: stat_cmds_messages.h stat_cmds_messages.cc
+ @echo Message files regenerated
+
+stat_cmds_messages.h stat_cmds_messages.cc: stat_cmds_messages.mes
+ $(top_builddir)/src/lib/log/compiler/kea-msg-compiler $(top_srcdir)/src/hooks/dhcp/stat_cmds/stat_cmds_messages.mes
+
+else
+
+messages stat_cmds_messages.h stat_cmds_messages.cc:
+ @echo Messages generation disabled. Configure with --enable-generate-messages to enable it.
+
+endif
+
diff --git a/src/hooks/dhcp/stat_cmds/Makefile.in b/src/hooks/dhcp/stat_cmds/Makefile.in
new file mode 100644
index 0000000..6e6ad49
--- /dev/null
+++ b/src/hooks/dhcp/stat_cmds/Makefile.in
@@ -0,0 +1,1064 @@
+# Makefile.in generated by automake 1.16.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2018 Free Software Foundation, Inc.
+
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+VPATH = @srcdir@
+am__is_gnu_make = { \
+ if test -z '$(MAKELEVEL)'; then \
+ false; \
+ elif test -n '$(MAKE_HOST)'; then \
+ true; \
+ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+ true; \
+ else \
+ false; \
+ fi; \
+}
+am__make_running_with_option = \
+ case $${target_option-} in \
+ ?) ;; \
+ *) echo "am__make_running_with_option: internal error: invalid" \
+ "target option '$${target_option-}' specified" >&2; \
+ exit 1;; \
+ esac; \
+ has_opt=no; \
+ sane_makeflags=$$MAKEFLAGS; \
+ if $(am__is_gnu_make); then \
+ sane_makeflags=$$MFLAGS; \
+ else \
+ case $$MAKEFLAGS in \
+ *\\[\ \ ]*) \
+ bs=\\; \
+ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
+ esac; \
+ fi; \
+ skip_next=no; \
+ strip_trailopt () \
+ { \
+ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+ }; \
+ for flg in $$sane_makeflags; do \
+ test $$skip_next = yes && { skip_next=no; continue; }; \
+ case $$flg in \
+ *=*|--*) continue;; \
+ -*I) strip_trailopt 'I'; skip_next=yes;; \
+ -*I?*) strip_trailopt 'I';; \
+ -*O) strip_trailopt 'O'; skip_next=yes;; \
+ -*O?*) strip_trailopt 'O';; \
+ -*l) strip_trailopt 'l'; skip_next=yes;; \
+ -*l?*) strip_trailopt 'l';; \
+ -[dEDm]) skip_next=yes;; \
+ -[JT]) skip_next=yes;; \
+ esac; \
+ case $$flg in \
+ *$$target_option*) has_opt=yes; break;; \
+ esac; \
+ done; \
+ test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = src/hooks/dhcp/stat_cmds
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4macros/ax_boost_for_kea.m4 \
+ $(top_srcdir)/m4macros/ax_cpp11.m4 \
+ $(top_srcdir)/m4macros/ax_cpp20.m4 \
+ $(top_srcdir)/m4macros/ax_crypto.m4 \
+ $(top_srcdir)/m4macros/ax_find_library.m4 \
+ $(top_srcdir)/m4macros/ax_gssapi.m4 \
+ $(top_srcdir)/m4macros/ax_gtest.m4 \
+ $(top_srcdir)/m4macros/ax_isc_rpath.m4 \
+ $(top_srcdir)/m4macros/ax_netconf.m4 \
+ $(top_srcdir)/m4macros/libtool.m4 \
+ $(top_srcdir)/m4macros/ltoptions.m4 \
+ $(top_srcdir)/m4macros/ltsugar.m4 \
+ $(top_srcdir)/m4macros/ltversion.m4 \
+ $(top_srcdir)/m4macros/lt~obsolete.m4 \
+ $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+ *) f=$$p;; \
+ esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+ for p in $$list; do echo "$$p $$p"; done | \
+ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+ if (++n[$$2] == $(am__install_max)) \
+ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+ END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+ test -z "$$files" \
+ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+ $(am__cd) "$$dir" && rm -f $$files; }; \
+ }
+am__installdirs = "$(DESTDIR)$(lib_hooksdir)"
+LTLIBRARIES = $(lib_hooks_LTLIBRARIES) $(noinst_LTLIBRARIES)
+am__DEPENDENCIES_1 =
+libdhcp_stat_cmds_la_DEPENDENCIES = libstat_cmds.la \
+ $(top_builddir)/src/lib/dhcpsrv/libkea-dhcpsrv.la \
+ $(top_builddir)/src/lib/process/libkea-process.la \
+ $(top_builddir)/src/lib/eval/libkea-eval.la \
+ $(top_builddir)/src/lib/dhcp_ddns/libkea-dhcp_ddns.la \
+ $(top_builddir)/src/lib/stats/libkea-stats.la \
+ $(top_builddir)/src/lib/config/libkea-cfgclient.la \
+ $(top_builddir)/src/lib/http/libkea-http.la \
+ $(top_builddir)/src/lib/dhcp/libkea-dhcp++.la \
+ $(top_builddir)/src/lib/hooks/libkea-hooks.la \
+ $(top_builddir)/src/lib/database/libkea-database.la \
+ $(top_builddir)/src/lib/cc/libkea-cc.la \
+ $(top_builddir)/src/lib/asiolink/libkea-asiolink.la \
+ $(top_builddir)/src/lib/dns/libkea-dns++.la \
+ $(top_builddir)/src/lib/cryptolink/libkea-cryptolink.la \
+ $(top_builddir)/src/lib/log/libkea-log.la \
+ $(top_builddir)/src/lib/util/libkea-util.la \
+ $(top_builddir)/src/lib/exceptions/libkea-exceptions.la \
+ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+ $(am__DEPENDENCIES_1)
+am_libdhcp_stat_cmds_la_OBJECTS =
+libdhcp_stat_cmds_la_OBJECTS = $(am_libdhcp_stat_cmds_la_OBJECTS)
+AM_V_lt = $(am__v_lt_@AM_V@)
+am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
+am__v_lt_0 = --silent
+am__v_lt_1 =
+libdhcp_stat_cmds_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
+ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \
+ $(AM_CFLAGS) $(CFLAGS) $(libdhcp_stat_cmds_la_LDFLAGS) \
+ $(LDFLAGS) -o $@
+libstat_cmds_la_LIBADD =
+am_libstat_cmds_la_OBJECTS = libstat_cmds_la-stat_cmds.lo \
+ libstat_cmds_la-stat_cmds_callouts.lo \
+ libstat_cmds_la-stat_cmds_log.lo \
+ libstat_cmds_la-stat_cmds_messages.lo \
+ libstat_cmds_la-version.lo
+libstat_cmds_la_OBJECTS = $(am_libstat_cmds_la_OBJECTS)
+libstat_cmds_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX \
+ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CXXLD) \
+ $(libstat_cmds_la_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
+ $(LDFLAGS) -o $@
+AM_V_P = $(am__v_P_@AM_V@)
+am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_@AM_V@)
+am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
+am__v_GEN_0 = @echo " GEN " $@;
+am__v_GEN_1 =
+AM_V_at = $(am__v_at_@AM_V@)
+am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
+am__v_at_0 = @
+am__v_at_1 =
+DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__maybe_remake_depfiles = depfiles
+am__depfiles_remade = ./$(DEPDIR)/libstat_cmds_la-stat_cmds.Plo \
+ ./$(DEPDIR)/libstat_cmds_la-stat_cmds_callouts.Plo \
+ ./$(DEPDIR)/libstat_cmds_la-stat_cmds_log.Plo \
+ ./$(DEPDIR)/libstat_cmds_la-stat_cmds_messages.Plo \
+ ./$(DEPDIR)/libstat_cmds_la-version.Plo
+am__mv = mv -f
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+LTCXXCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) \
+ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+ $(AM_CXXFLAGS) $(CXXFLAGS)
+AM_V_CXX = $(am__v_CXX_@AM_V@)
+am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@)
+am__v_CXX_0 = @echo " CXX " $@;
+am__v_CXX_1 =
+CXXLD = $(CXX)
+CXXLINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \
+ $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_CXXLD = $(am__v_CXXLD_@AM_V@)
+am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@)
+am__v_CXXLD_0 = @echo " CXXLD " $@;
+am__v_CXXLD_1 =
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
+ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+ $(AM_CFLAGS) $(CFLAGS)
+AM_V_CC = $(am__v_CC_@AM_V@)
+am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
+am__v_CC_0 = @echo " CC " $@;
+am__v_CC_1 =
+CCLD = $(CC)
+LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+ $(AM_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_CCLD = $(am__v_CCLD_@AM_V@)
+am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
+am__v_CCLD_0 = @echo " CCLD " $@;
+am__v_CCLD_1 =
+SOURCES = $(libdhcp_stat_cmds_la_SOURCES) $(libstat_cmds_la_SOURCES)
+DIST_SOURCES = $(libdhcp_stat_cmds_la_SOURCES) \
+ $(libstat_cmds_la_SOURCES)
+RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \
+ ctags-recursive dvi-recursive html-recursive info-recursive \
+ install-data-recursive install-dvi-recursive \
+ install-exec-recursive install-html-recursive \
+ install-info-recursive install-pdf-recursive \
+ install-ps-recursive install-recursive installcheck-recursive \
+ installdirs-recursive pdf-recursive ps-recursive \
+ tags-recursive uninstall-recursive
+am__can_run_installinfo = \
+ case $$AM_UPDATE_INFO_DIR in \
+ n|no|NO) false;; \
+ *) (install-info --version) >/dev/null 2>&1;; \
+ esac
+RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
+ distclean-recursive maintainer-clean-recursive
+am__recursive_targets = \
+ $(RECURSIVE_TARGETS) \
+ $(RECURSIVE_CLEAN_TARGETS) \
+ $(am__extra_recursive_targets)
+AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
+ distdir distdir-am
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+# Read a list of newline-separated strings from the standard input,
+# and print each of them once, without duplicates. Input order is
+# *not* preserved.
+am__uniquify_input = $(AWK) '\
+ BEGIN { nonempty = 0; } \
+ { items[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in items) print i; }; } \
+'
+# Make sure the list of sources is unique. This is necessary because,
+# e.g., the same source file might be shared among _SOURCES variables
+# for different programs/libraries.
+am__define_uniq_tagged_files = \
+ list='$(am__tagged_files)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | $(am__uniquify_input)`
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = $(SUBDIRS)
+am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+am__relativize = \
+ dir0=`pwd`; \
+ sed_first='s,^\([^/]*\)/.*$$,\1,'; \
+ sed_rest='s,^[^/]*/*,,'; \
+ sed_last='s,^.*/\([^/]*\)$$,\1,'; \
+ sed_butlast='s,/*[^/]*$$,,'; \
+ while test -n "$$dir1"; do \
+ first=`echo "$$dir1" | sed -e "$$sed_first"`; \
+ if test "$$first" != "."; then \
+ if test "$$first" = ".."; then \
+ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
+ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
+ else \
+ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
+ if test "$$first2" = "$$first"; then \
+ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
+ else \
+ dir2="../$$dir2"; \
+ fi; \
+ dir0="$$dir0"/"$$first"; \
+ fi; \
+ fi; \
+ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
+ done; \
+ reldir="$$dir2"
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+ASCIIDOC = @ASCIIDOC@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BOOST_INCLUDES = @BOOST_INCLUDES@
+BOOST_LIBS = @BOOST_LIBS@
+BOTAN_TOOL = @BOTAN_TOOL@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CONTRIB_DIR = @CONTRIB_DIR@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CRYPTO_CFLAGS = @CRYPTO_CFLAGS@
+CRYPTO_INCLUDES = @CRYPTO_INCLUDES@
+CRYPTO_LDFLAGS = @CRYPTO_LDFLAGS@
+CRYPTO_LIBS = @CRYPTO_LIBS@
+CRYPTO_PACKAGE = @CRYPTO_PACKAGE@
+CRYPTO_RPATH = @CRYPTO_RPATH@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DISTCHECK_BOOST_CONFIGURE_FLAG = @DISTCHECK_BOOST_CONFIGURE_FLAG@
+DISTCHECK_CONTRIB_CONFIGURE_FLAG = @DISTCHECK_CONTRIB_CONFIGURE_FLAG@
+DISTCHECK_CRYPTO_CONFIGURE_FLAG = @DISTCHECK_CRYPTO_CONFIGURE_FLAG@
+DISTCHECK_GSSAPI_CONFIGURE_FLAG = @DISTCHECK_GSSAPI_CONFIGURE_FLAG@
+DISTCHECK_GTEST_CONFIGURE_FLAG = @DISTCHECK_GTEST_CONFIGURE_FLAG@
+DISTCHECK_KEA_SHELL_CONFIGURE_FLAG = @DISTCHECK_KEA_SHELL_CONFIGURE_FLAG@
+DISTCHECK_LIBYANGCPP_CONFIGURE_FLAG = @DISTCHECK_LIBYANGCPP_CONFIGURE_FLAG@
+DISTCHECK_LIBYANG_CONFIGURE_FLAG = @DISTCHECK_LIBYANG_CONFIGURE_FLAG@
+DISTCHECK_LOG4CPLUS_CONFIGURE_FLAG = @DISTCHECK_LOG4CPLUS_CONFIGURE_FLAG@
+DISTCHECK_MYSQL_CONFIGURE_FLAG = @DISTCHECK_MYSQL_CONFIGURE_FLAG@
+DISTCHECK_PERFDHCP_CONFIGURE_FLAG = @DISTCHECK_PERFDHCP_CONFIGURE_FLAG@
+DISTCHECK_PGSQL_CONFIGURE_FLAG = @DISTCHECK_PGSQL_CONFIGURE_FLAG@
+DISTCHECK_PREMIUM_CONFIGURE_FLAG = @DISTCHECK_PREMIUM_CONFIGURE_FLAG@
+DISTCHECK_SYSREPOCPP_CONFIGURE_FLAG = @DISTCHECK_SYSREPOCPP_CONFIGURE_FLAG@
+DISTCHECK_SYSREPO_CONFIGURE_FLAG = @DISTCHECK_SYSREPO_CONFIGURE_FLAG@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GENHTML = @GENHTML@
+GREP = @GREP@
+GSSAPI_CFLAGS = @GSSAPI_CFLAGS@
+GSSAPI_LIBS = @GSSAPI_LIBS@
+GTEST_CONFIG = @GTEST_CONFIG@
+GTEST_INCLUDES = @GTEST_INCLUDES@
+GTEST_LDADD = @GTEST_LDADD@
+GTEST_LDFLAGS = @GTEST_LDFLAGS@
+GTEST_SOURCE = @GTEST_SOURCE@
+HAVE_NETCONF = @HAVE_NETCONF@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+KEA_CXXFLAGS = @KEA_CXXFLAGS@
+KEA_SRCID = @KEA_SRCID@
+KRB5_CONFIG = @KRB5_CONFIG@
+LCOV = @LCOV@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LEX = @LEX@
+LEXLIB = @LEXLIB@
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIBYANGCPP_CPPFLAGS = @LIBYANGCPP_CPPFLAGS@
+LIBYANGCPP_INCLUDEDIR = @LIBYANGCPP_INCLUDEDIR@
+LIBYANGCPP_LIBS = @LIBYANGCPP_LIBS@
+LIBYANGCPP_PREFIX = @LIBYANGCPP_PREFIX@
+LIBYANGCPP_VERSION = @LIBYANGCPP_VERSION@
+LIBYANG_CPPFLAGS = @LIBYANG_CPPFLAGS@
+LIBYANG_INCLUDEDIR = @LIBYANG_INCLUDEDIR@
+LIBYANG_LIBS = @LIBYANG_LIBS@
+LIBYANG_PREFIX = @LIBYANG_PREFIX@
+LIBYANG_VERSION = @LIBYANG_VERSION@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LOG4CPLUS_INCLUDES = @LOG4CPLUS_INCLUDES@
+LOG4CPLUS_LIBS = @LOG4CPLUS_LIBS@
+LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+MYSQL_CPPFLAGS = @MYSQL_CPPFLAGS@
+MYSQL_LIBS = @MYSQL_LIBS@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PACKAGE_VERSION_TYPE = @PACKAGE_VERSION_TYPE@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PDFLATEX = @PDFLATEX@
+PERL = @PERL@
+PGSQL_CPPFLAGS = @PGSQL_CPPFLAGS@
+PGSQL_LIBS = @PGSQL_LIBS@
+PKGPYTHONDIR = @PKGPYTHONDIR@
+PKG_CONFIG = @PKG_CONFIG@
+PLANTUML = @PLANTUML@
+PREMIUM_DIR = @PREMIUM_DIR@
+PYTHON = @PYTHON@
+PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
+PYTHON_PLATFORM = @PYTHON_PLATFORM@
+PYTHON_PREFIX = @PYTHON_PREFIX@
+PYTHON_VERSION = @PYTHON_VERSION@
+RANLIB = @RANLIB@
+SED = @SED@
+SEP = @SEP@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SPHINXBUILD = @SPHINXBUILD@
+SRPD_PLUGINS_PATH = @SRPD_PLUGINS_PATH@
+SR_PLUGINS_PATH = @SR_PLUGINS_PATH@
+SR_REPO_PATH = @SR_REPO_PATH@
+STRIP = @STRIP@
+SYSREPOCPP_CPPFLAGS = @SYSREPOCPP_CPPFLAGS@
+SYSREPOCPP_INCLUDEDIR = @SYSREPOCPP_INCLUDEDIR@
+SYSREPOCPP_LIBS = @SYSREPOCPP_LIBS@
+SYSREPOCPP_PREFIX = @SYSREPOCPP_PREFIX@
+SYSREPOCPP_VERSION = @SYSREPOCPP_VERSION@
+SYSREPO_CPPFLAGS = @SYSREPO_CPPFLAGS@
+SYSREPO_INCLUDEDIR = @SYSREPO_INCLUDEDIR@
+SYSREPO_LIBS = @SYSREPO_LIBS@
+SYSREPO_PREFIX = @SYSREPO_PREFIX@
+SYSREPO_VERSION = @SYSREPO_VERSION@
+USE_LCOV = @USE_LCOV@
+VALGRIND = @VALGRIND@
+VERSION = @VERSION@
+WARNING_GCC_44_STRICT_ALIASING_CFLAG = @WARNING_GCC_44_STRICT_ALIASING_CFLAG@
+YACC = @YACC@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+pkgpyexecdir = @pkgpyexecdir@
+pkgpythondir = @pkgpythondir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+pyexecdir = @pyexecdir@
+pythondir = @pythondir@
+runstatedir = @runstatedir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+SUBDIRS = . tests libloadtests
+AM_CPPFLAGS = -I$(top_builddir)/src/lib -I$(top_srcdir)/src/lib \
+ $(BOOST_INCLUDES)
+AM_CXXFLAGS = $(KEA_CXXFLAGS)
+
+# Ensure that the message file and doxygen file is included in the distribution
+EXTRA_DIST = stat_cmds_messages.mes stat_cmds.dox
+CLEANFILES = *.gcno *.gcda
+
+# convenience archive
+noinst_LTLIBRARIES = libstat_cmds.la
+libstat_cmds_la_SOURCES = stat_cmds.cc stat_cmds.h \
+ stat_cmds_callouts.cc stat_cmds_log.cc stat_cmds_log.h \
+ stat_cmds_messages.cc stat_cmds_messages.h version.cc
+libstat_cmds_la_CXXFLAGS = $(AM_CXXFLAGS)
+libstat_cmds_la_CPPFLAGS = $(AM_CPPFLAGS)
+
+# install the shared object into $(libdir)/kea/hooks
+lib_hooksdir = $(libdir)/kea/hooks
+lib_hooks_LTLIBRARIES = libdhcp_stat_cmds.la
+libdhcp_stat_cmds_la_SOURCES =
+libdhcp_stat_cmds_la_LDFLAGS = $(AM_LDFLAGS) -avoid-version \
+ -export-dynamic -module
+libdhcp_stat_cmds_la_LIBADD = libstat_cmds.la \
+ $(top_builddir)/src/lib/dhcpsrv/libkea-dhcpsrv.la \
+ $(top_builddir)/src/lib/process/libkea-process.la \
+ $(top_builddir)/src/lib/eval/libkea-eval.la \
+ $(top_builddir)/src/lib/dhcp_ddns/libkea-dhcp_ddns.la \
+ $(top_builddir)/src/lib/stats/libkea-stats.la \
+ $(top_builddir)/src/lib/config/libkea-cfgclient.la \
+ $(top_builddir)/src/lib/http/libkea-http.la \
+ $(top_builddir)/src/lib/dhcp/libkea-dhcp++.la \
+ $(top_builddir)/src/lib/hooks/libkea-hooks.la \
+ $(top_builddir)/src/lib/database/libkea-database.la \
+ $(top_builddir)/src/lib/cc/libkea-cc.la \
+ $(top_builddir)/src/lib/asiolink/libkea-asiolink.la \
+ $(top_builddir)/src/lib/dns/libkea-dns++.la \
+ $(top_builddir)/src/lib/cryptolink/libkea-cryptolink.la \
+ $(top_builddir)/src/lib/log/libkea-log.la \
+ $(top_builddir)/src/lib/util/libkea-util.la \
+ $(top_builddir)/src/lib/exceptions/libkea-exceptions.la \
+ $(LOG4CPLUS_LIBS) $(CRYPTO_LIBS) $(BOOST_LIBS)
+all: all-recursive
+
+.SUFFIXES:
+.SUFFIXES: .cc .lo .o .obj
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+ && { if test -f $@; then exit 0; else break; fi; }; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/hooks/dhcp/stat_cmds/Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --foreign src/hooks/dhcp/stat_cmds/Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+
+install-lib_hooksLTLIBRARIES: $(lib_hooks_LTLIBRARIES)
+ @$(NORMAL_INSTALL)
+ @list='$(lib_hooks_LTLIBRARIES)'; test -n "$(lib_hooksdir)" || list=; \
+ list2=; for p in $$list; do \
+ if test -f $$p; then \
+ list2="$$list2 $$p"; \
+ else :; fi; \
+ done; \
+ test -z "$$list2" || { \
+ echo " $(MKDIR_P) '$(DESTDIR)$(lib_hooksdir)'"; \
+ $(MKDIR_P) "$(DESTDIR)$(lib_hooksdir)" || exit 1; \
+ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(lib_hooksdir)'"; \
+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(lib_hooksdir)"; \
+ }
+
+uninstall-lib_hooksLTLIBRARIES:
+ @$(NORMAL_UNINSTALL)
+ @list='$(lib_hooks_LTLIBRARIES)'; test -n "$(lib_hooksdir)" || list=; \
+ for p in $$list; do \
+ $(am__strip_dir) \
+ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(lib_hooksdir)/$$f'"; \
+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(lib_hooksdir)/$$f"; \
+ done
+
+clean-lib_hooksLTLIBRARIES:
+ -test -z "$(lib_hooks_LTLIBRARIES)" || rm -f $(lib_hooks_LTLIBRARIES)
+ @list='$(lib_hooks_LTLIBRARIES)'; \
+ locs=`for p in $$list; do echo $$p; done | \
+ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
+ sort -u`; \
+ test -z "$$locs" || { \
+ echo rm -f $${locs}; \
+ rm -f $${locs}; \
+ }
+
+clean-noinstLTLIBRARIES:
+ -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
+ @list='$(noinst_LTLIBRARIES)'; \
+ locs=`for p in $$list; do echo $$p; done | \
+ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
+ sort -u`; \
+ test -z "$$locs" || { \
+ echo rm -f $${locs}; \
+ rm -f $${locs}; \
+ }
+
+libdhcp_stat_cmds.la: $(libdhcp_stat_cmds_la_OBJECTS) $(libdhcp_stat_cmds_la_DEPENDENCIES) $(EXTRA_libdhcp_stat_cmds_la_DEPENDENCIES)
+ $(AM_V_CCLD)$(libdhcp_stat_cmds_la_LINK) -rpath $(lib_hooksdir) $(libdhcp_stat_cmds_la_OBJECTS) $(libdhcp_stat_cmds_la_LIBADD) $(LIBS)
+
+libstat_cmds.la: $(libstat_cmds_la_OBJECTS) $(libstat_cmds_la_DEPENDENCIES) $(EXTRA_libstat_cmds_la_DEPENDENCIES)
+ $(AM_V_CXXLD)$(libstat_cmds_la_LINK) $(libstat_cmds_la_OBJECTS) $(libstat_cmds_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libstat_cmds_la-stat_cmds.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libstat_cmds_la-stat_cmds_callouts.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libstat_cmds_la-stat_cmds_log.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libstat_cmds_la-stat_cmds_messages.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libstat_cmds_la-version.Plo@am__quote@ # am--include-marker
+
+$(am__depfiles_remade):
+ @$(MKDIR_P) $(@D)
+ @echo '# dummy' >$@-t && $(am__mv) $@-t $@
+
+am--depfiles: $(am__depfiles_remade)
+
+.cc.o:
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $<
+
+.cc.obj:
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cc.lo:
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LTCXXCOMPILE) -c -o $@ $<
+
+libstat_cmds_la-stat_cmds.lo: stat_cmds.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstat_cmds_la_CPPFLAGS) $(CPPFLAGS) $(libstat_cmds_la_CXXFLAGS) $(CXXFLAGS) -MT libstat_cmds_la-stat_cmds.lo -MD -MP -MF $(DEPDIR)/libstat_cmds_la-stat_cmds.Tpo -c -o libstat_cmds_la-stat_cmds.lo `test -f 'stat_cmds.cc' || echo '$(srcdir)/'`stat_cmds.cc
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libstat_cmds_la-stat_cmds.Tpo $(DEPDIR)/libstat_cmds_la-stat_cmds.Plo
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='stat_cmds.cc' object='libstat_cmds_la-stat_cmds.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstat_cmds_la_CPPFLAGS) $(CPPFLAGS) $(libstat_cmds_la_CXXFLAGS) $(CXXFLAGS) -c -o libstat_cmds_la-stat_cmds.lo `test -f 'stat_cmds.cc' || echo '$(srcdir)/'`stat_cmds.cc
+
+libstat_cmds_la-stat_cmds_callouts.lo: stat_cmds_callouts.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstat_cmds_la_CPPFLAGS) $(CPPFLAGS) $(libstat_cmds_la_CXXFLAGS) $(CXXFLAGS) -MT libstat_cmds_la-stat_cmds_callouts.lo -MD -MP -MF $(DEPDIR)/libstat_cmds_la-stat_cmds_callouts.Tpo -c -o libstat_cmds_la-stat_cmds_callouts.lo `test -f 'stat_cmds_callouts.cc' || echo '$(srcdir)/'`stat_cmds_callouts.cc
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libstat_cmds_la-stat_cmds_callouts.Tpo $(DEPDIR)/libstat_cmds_la-stat_cmds_callouts.Plo
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='stat_cmds_callouts.cc' object='libstat_cmds_la-stat_cmds_callouts.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstat_cmds_la_CPPFLAGS) $(CPPFLAGS) $(libstat_cmds_la_CXXFLAGS) $(CXXFLAGS) -c -o libstat_cmds_la-stat_cmds_callouts.lo `test -f 'stat_cmds_callouts.cc' || echo '$(srcdir)/'`stat_cmds_callouts.cc
+
+libstat_cmds_la-stat_cmds_log.lo: stat_cmds_log.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstat_cmds_la_CPPFLAGS) $(CPPFLAGS) $(libstat_cmds_la_CXXFLAGS) $(CXXFLAGS) -MT libstat_cmds_la-stat_cmds_log.lo -MD -MP -MF $(DEPDIR)/libstat_cmds_la-stat_cmds_log.Tpo -c -o libstat_cmds_la-stat_cmds_log.lo `test -f 'stat_cmds_log.cc' || echo '$(srcdir)/'`stat_cmds_log.cc
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libstat_cmds_la-stat_cmds_log.Tpo $(DEPDIR)/libstat_cmds_la-stat_cmds_log.Plo
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='stat_cmds_log.cc' object='libstat_cmds_la-stat_cmds_log.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstat_cmds_la_CPPFLAGS) $(CPPFLAGS) $(libstat_cmds_la_CXXFLAGS) $(CXXFLAGS) -c -o libstat_cmds_la-stat_cmds_log.lo `test -f 'stat_cmds_log.cc' || echo '$(srcdir)/'`stat_cmds_log.cc
+
+libstat_cmds_la-stat_cmds_messages.lo: stat_cmds_messages.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstat_cmds_la_CPPFLAGS) $(CPPFLAGS) $(libstat_cmds_la_CXXFLAGS) $(CXXFLAGS) -MT libstat_cmds_la-stat_cmds_messages.lo -MD -MP -MF $(DEPDIR)/libstat_cmds_la-stat_cmds_messages.Tpo -c -o libstat_cmds_la-stat_cmds_messages.lo `test -f 'stat_cmds_messages.cc' || echo '$(srcdir)/'`stat_cmds_messages.cc
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libstat_cmds_la-stat_cmds_messages.Tpo $(DEPDIR)/libstat_cmds_la-stat_cmds_messages.Plo
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='stat_cmds_messages.cc' object='libstat_cmds_la-stat_cmds_messages.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstat_cmds_la_CPPFLAGS) $(CPPFLAGS) $(libstat_cmds_la_CXXFLAGS) $(CXXFLAGS) -c -o libstat_cmds_la-stat_cmds_messages.lo `test -f 'stat_cmds_messages.cc' || echo '$(srcdir)/'`stat_cmds_messages.cc
+
+libstat_cmds_la-version.lo: version.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstat_cmds_la_CPPFLAGS) $(CPPFLAGS) $(libstat_cmds_la_CXXFLAGS) $(CXXFLAGS) -MT libstat_cmds_la-version.lo -MD -MP -MF $(DEPDIR)/libstat_cmds_la-version.Tpo -c -o libstat_cmds_la-version.lo `test -f 'version.cc' || echo '$(srcdir)/'`version.cc
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libstat_cmds_la-version.Tpo $(DEPDIR)/libstat_cmds_la-version.Plo
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='version.cc' object='libstat_cmds_la-version.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstat_cmds_la_CPPFLAGS) $(CPPFLAGS) $(libstat_cmds_la_CXXFLAGS) $(CXXFLAGS) -c -o libstat_cmds_la-version.lo `test -f 'version.cc' || echo '$(srcdir)/'`version.cc
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run 'make' without going through this Makefile.
+# To change the values of 'make' variables: instead of editing Makefiles,
+# (1) if the variable is set in 'config.status', edit 'config.status'
+# (which will cause the Makefiles to be regenerated when you run 'make');
+# (2) otherwise, pass the desired values on the 'make' command line.
+$(am__recursive_targets):
+ @fail=; \
+ if $(am__make_keepgoing); then \
+ failcom='fail=yes'; \
+ else \
+ failcom='exit 1'; \
+ fi; \
+ dot_seen=no; \
+ target=`echo $@ | sed s/-recursive//`; \
+ case "$@" in \
+ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+ *) list='$(SUBDIRS)' ;; \
+ esac; \
+ for subdir in $$list; do \
+ echo "Making $$target in $$subdir"; \
+ if test "$$subdir" = "."; then \
+ dot_seen=yes; \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || eval $$failcom; \
+ done; \
+ if test "$$dot_seen" = "no"; then \
+ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+ fi; test -z "$$fail"
+
+ID: $(am__tagged_files)
+ $(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-recursive
+TAGS: tags
+
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+ set x; \
+ here=`pwd`; \
+ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+ include_option=--etags-include; \
+ empty_fix=.; \
+ else \
+ include_option=--include; \
+ empty_fix=; \
+ fi; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ test ! -f $$subdir/TAGS || \
+ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
+ fi; \
+ done; \
+ $(am__define_uniq_tagged_files); \
+ shift; \
+ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ if test $$# -gt 0; then \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ "$$@" $$unique; \
+ else \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$unique; \
+ fi; \
+ fi
+ctags: ctags-recursive
+
+CTAGS: ctags
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+ $(am__define_uniq_tagged_files); \
+ test -z "$(CTAGS_ARGS)$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && $(am__cd) $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) "$$here"
+cscopelist: cscopelist-recursive
+
+cscopelist-am: $(am__tagged_files)
+ list='$(am__tagged_files)'; \
+ case "$(srcdir)" in \
+ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+ *) sdir=$(subdir)/$(srcdir) ;; \
+ esac; \
+ for i in $$list; do \
+ if test -f "$$i"; then \
+ echo "$(subdir)/$$i"; \
+ else \
+ echo "$$sdir/$$i"; \
+ fi; \
+ done >> $(top_builddir)/cscope.files
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(BUILT_SOURCES)
+ $(MAKE) $(AM_MAKEFLAGS) distdir-am
+
+distdir-am: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d "$(distdir)/$$file"; then \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+ else \
+ test -f "$(distdir)/$$file" \
+ || cp -p $$d/$$file "$(distdir)/$$file" \
+ || exit 1; \
+ fi; \
+ done
+ @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ $(am__make_dryrun) \
+ || test -d "$(distdir)/$$subdir" \
+ || $(MKDIR_P) "$(distdir)/$$subdir" \
+ || exit 1; \
+ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
+ $(am__relativize); \
+ new_distdir=$$reldir; \
+ dir1=$$subdir; dir2="$(top_distdir)"; \
+ $(am__relativize); \
+ new_top_distdir=$$reldir; \
+ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
+ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
+ ($(am__cd) $$subdir && \
+ $(MAKE) $(AM_MAKEFLAGS) \
+ top_distdir="$$new_top_distdir" \
+ distdir="$$new_distdir" \
+ am__remove_distdir=: \
+ am__skip_length_check=: \
+ am__skip_mode_fix=: \
+ distdir) \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-recursive
+all-am: Makefile $(LTLIBRARIES)
+installdirs: installdirs-recursive
+installdirs-am:
+ for dir in "$(DESTDIR)$(lib_hooksdir)"; do \
+ test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+ done
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+ if test -z '$(STRIP)'; then \
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ install; \
+ else \
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+ fi
+mostlyclean-generic:
+
+clean-generic:
+ -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+ -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
+
+clean-am: clean-generic clean-lib_hooksLTLIBRARIES clean-libtool \
+ clean-noinstLTLIBRARIES mostlyclean-am
+
+distclean: distclean-recursive
+ -rm -f ./$(DEPDIR)/libstat_cmds_la-stat_cmds.Plo
+ -rm -f ./$(DEPDIR)/libstat_cmds_la-stat_cmds_callouts.Plo
+ -rm -f ./$(DEPDIR)/libstat_cmds_la-stat_cmds_log.Plo
+ -rm -f ./$(DEPDIR)/libstat_cmds_la-stat_cmds_messages.Plo
+ -rm -f ./$(DEPDIR)/libstat_cmds_la-version.Plo
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+html-am:
+
+info: info-recursive
+
+info-am:
+
+install-data-am: install-lib_hooksLTLIBRARIES
+
+install-dvi: install-dvi-recursive
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-recursive
+
+install-html-am:
+
+install-info: install-info-recursive
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-recursive
+
+install-pdf-am:
+
+install-ps: install-ps-recursive
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+ -rm -f ./$(DEPDIR)/libstat_cmds_la-stat_cmds.Plo
+ -rm -f ./$(DEPDIR)/libstat_cmds_la-stat_cmds_callouts.Plo
+ -rm -f ./$(DEPDIR)/libstat_cmds_la-stat_cmds_log.Plo
+ -rm -f ./$(DEPDIR)/libstat_cmds_la-stat_cmds_messages.Plo
+ -rm -f ./$(DEPDIR)/libstat_cmds_la-version.Plo
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic \
+ maintainer-clean-local
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+ mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am: uninstall-lib_hooksLTLIBRARIES
+
+.MAKE: $(am__recursive_targets) install-am install-strip
+
+.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \
+ am--depfiles check check-am clean clean-generic \
+ clean-lib_hooksLTLIBRARIES clean-libtool \
+ clean-noinstLTLIBRARIES cscopelist-am ctags ctags-am distclean \
+ distclean-compile distclean-generic distclean-libtool \
+ distclean-tags distdir dvi dvi-am html html-am info info-am \
+ install install-am install-data install-data-am install-dvi \
+ install-dvi-am install-exec install-exec-am install-html \
+ install-html-am install-info install-info-am \
+ install-lib_hooksLTLIBRARIES install-man install-pdf \
+ install-pdf-am install-ps install-ps-am install-strip \
+ installcheck installcheck-am installdirs installdirs-am \
+ maintainer-clean maintainer-clean-generic \
+ maintainer-clean-local mostlyclean mostlyclean-compile \
+ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+ tags tags-am uninstall uninstall-am \
+ uninstall-lib_hooksLTLIBRARIES
+
+.PRECIOUS: Makefile
+
+
+# If we want to get rid of all generated messages files, we need to use
+# make maintainer-clean. The proper way to introduce custom commands for
+# that operation is to define maintainer-clean-local target. However,
+# make maintainer-clean also removes Makefile, so running configure script
+# is required. To make it easy to rebuild messages without going through
+# reconfigure, a new target messages-clean has been added.
+maintainer-clean-local:
+ rm -f stat_cmds_messages.h stat_cmds_messages.cc
+
+# To regenerate messages files, one can do:
+#
+# make messages-clean
+# make messages
+#
+# This is needed only when a .mes file is modified.
+messages-clean: maintainer-clean-local
+
+# Define rule to build logging source files from message file
+@GENERATE_MESSAGES_TRUE@messages: stat_cmds_messages.h stat_cmds_messages.cc
+@GENERATE_MESSAGES_TRUE@ @echo Message files regenerated
+
+@GENERATE_MESSAGES_TRUE@stat_cmds_messages.h stat_cmds_messages.cc: stat_cmds_messages.mes
+@GENERATE_MESSAGES_TRUE@ $(top_builddir)/src/lib/log/compiler/kea-msg-compiler $(top_srcdir)/src/hooks/dhcp/stat_cmds/stat_cmds_messages.mes
+
+@GENERATE_MESSAGES_FALSE@messages stat_cmds_messages.h stat_cmds_messages.cc:
+@GENERATE_MESSAGES_FALSE@ @echo Messages generation disabled. Configure with --enable-generate-messages to enable it.
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/src/hooks/dhcp/stat_cmds/libloadtests/Makefile.am b/src/hooks/dhcp/stat_cmds/libloadtests/Makefile.am
new file mode 100644
index 0000000..40a9549
--- /dev/null
+++ b/src/hooks/dhcp/stat_cmds/libloadtests/Makefile.am
@@ -0,0 +1,55 @@
+SUBDIRS = .
+
+AM_CPPFLAGS = -I$(top_builddir)/src/lib -I$(top_srcdir)/src/lib
+AM_CPPFLAGS += -I$(top_builddir)/src/hooks/dhcp/stat_cmds -I$(top_srcdir)/src/hooks/dhcp/stat_cmds
+AM_CPPFLAGS += $(BOOST_INCLUDES)
+AM_CPPFLAGS += -DLIBDHCP_STAT_CMDS_SO=\"$(abs_top_builddir)/src/hooks/dhcp/stat_cmds/.libs/libdhcp_stat_cmds.so\"
+AM_CXXFLAGS = $(KEA_CXXFLAGS)
+
+if USE_STATIC_LINK
+AM_LDFLAGS = -static
+endif
+
+EXTRA_DIST =
+
+CLEANFILES = *.gcno *.gcda
+
+TESTS_ENVIRONMENT = \
+ $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND)
+
+if HAVE_GTEST
+
+TESTS = hook_load_unittests
+
+hook_load_unittests_SOURCES =
+hook_load_unittests_SOURCES += load_unload_unittests.cc
+hook_load_unittests_SOURCES += run_unittests.cc
+hook_load_unittests_CPPFLAGS = $(AM_CPPFLAGS) $(GTEST_INCLUDES) $(LOG4CPLUS_INCLUDES)
+hook_load_unittests_CXXFLAGS = $(AM_CXXFLAGS)
+hook_load_unittests_LDFLAGS = $(AM_LDFLAGS) $(GTEST_LDFLAGS)
+
+hook_load_unittests_LDADD = $(top_builddir)/src/lib/dhcpsrv/libkea-dhcpsrv.la
+hook_load_unittests_LDADD += $(top_builddir)/src/lib/process/libkea-process.la
+hook_load_unittests_LDADD += $(top_builddir)/src/lib/eval/libkea-eval.la
+hook_load_unittests_LDADD += $(top_builddir)/src/lib/dhcp_ddns/libkea-dhcp_ddns.la
+hook_load_unittests_LDADD += $(top_builddir)/src/lib/stats/libkea-stats.la
+hook_load_unittests_LDADD += $(top_builddir)/src/lib/config/libkea-cfgclient.la
+hook_load_unittests_LDADD += $(top_builddir)/src/lib/http/libkea-http.la
+hook_load_unittests_LDADD += $(top_builddir)/src/lib/dhcp/libkea-dhcp++.la
+hook_load_unittests_LDADD += $(top_builddir)/src/lib/hooks/libkea-hooks.la
+hook_load_unittests_LDADD += $(top_builddir)/src/lib/database/libkea-database.la
+hook_load_unittests_LDADD += $(top_builddir)/src/lib/cc/libkea-cc.la
+hook_load_unittests_LDADD += $(top_builddir)/src/lib/asiolink/libkea-asiolink.la
+hook_load_unittests_LDADD += $(top_builddir)/src/lib/dns/libkea-dns++.la
+hook_load_unittests_LDADD += $(top_builddir)/src/lib/cryptolink/libkea-cryptolink.la
+hook_load_unittests_LDADD += $(top_builddir)/src/lib/log/libkea-log.la
+hook_load_unittests_LDADD += $(top_builddir)/src/lib/util/libkea-util.la
+hook_load_unittests_LDADD += $(top_builddir)/src/lib/exceptions/libkea-exceptions.la
+hook_load_unittests_LDADD += $(LOG4CPLUS_LIBS)
+hook_load_unittests_LDADD += $(CRYPTO_LIBS)
+hook_load_unittests_LDADD += $(BOOST_LIBS)
+hook_load_unittests_LDADD += $(GTEST_LDADD)
+
+noinst_PROGRAMS = $(TESTS)
+
+endif
diff --git a/src/hooks/dhcp/stat_cmds/libloadtests/Makefile.in b/src/hooks/dhcp/stat_cmds/libloadtests/Makefile.in
new file mode 100644
index 0000000..f5fd60c
--- /dev/null
+++ b/src/hooks/dhcp/stat_cmds/libloadtests/Makefile.in
@@ -0,0 +1,1030 @@
+# Makefile.in generated by automake 1.16.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2018 Free Software Foundation, Inc.
+
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+VPATH = @srcdir@
+am__is_gnu_make = { \
+ if test -z '$(MAKELEVEL)'; then \
+ false; \
+ elif test -n '$(MAKE_HOST)'; then \
+ true; \
+ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+ true; \
+ else \
+ false; \
+ fi; \
+}
+am__make_running_with_option = \
+ case $${target_option-} in \
+ ?) ;; \
+ *) echo "am__make_running_with_option: internal error: invalid" \
+ "target option '$${target_option-}' specified" >&2; \
+ exit 1;; \
+ esac; \
+ has_opt=no; \
+ sane_makeflags=$$MAKEFLAGS; \
+ if $(am__is_gnu_make); then \
+ sane_makeflags=$$MFLAGS; \
+ else \
+ case $$MAKEFLAGS in \
+ *\\[\ \ ]*) \
+ bs=\\; \
+ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
+ esac; \
+ fi; \
+ skip_next=no; \
+ strip_trailopt () \
+ { \
+ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+ }; \
+ for flg in $$sane_makeflags; do \
+ test $$skip_next = yes && { skip_next=no; continue; }; \
+ case $$flg in \
+ *=*|--*) continue;; \
+ -*I) strip_trailopt 'I'; skip_next=yes;; \
+ -*I?*) strip_trailopt 'I';; \
+ -*O) strip_trailopt 'O'; skip_next=yes;; \
+ -*O?*) strip_trailopt 'O';; \
+ -*l) strip_trailopt 'l'; skip_next=yes;; \
+ -*l?*) strip_trailopt 'l';; \
+ -[dEDm]) skip_next=yes;; \
+ -[JT]) skip_next=yes;; \
+ esac; \
+ case $$flg in \
+ *$$target_option*) has_opt=yes; break;; \
+ esac; \
+ done; \
+ test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+@HAVE_GTEST_TRUE@TESTS = hook_load_unittests$(EXEEXT)
+@HAVE_GTEST_TRUE@noinst_PROGRAMS = $(am__EXEEXT_1)
+subdir = src/hooks/dhcp/stat_cmds/libloadtests
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4macros/ax_boost_for_kea.m4 \
+ $(top_srcdir)/m4macros/ax_cpp11.m4 \
+ $(top_srcdir)/m4macros/ax_cpp20.m4 \
+ $(top_srcdir)/m4macros/ax_crypto.m4 \
+ $(top_srcdir)/m4macros/ax_find_library.m4 \
+ $(top_srcdir)/m4macros/ax_gssapi.m4 \
+ $(top_srcdir)/m4macros/ax_gtest.m4 \
+ $(top_srcdir)/m4macros/ax_isc_rpath.m4 \
+ $(top_srcdir)/m4macros/ax_netconf.m4 \
+ $(top_srcdir)/m4macros/libtool.m4 \
+ $(top_srcdir)/m4macros/ltoptions.m4 \
+ $(top_srcdir)/m4macros/ltsugar.m4 \
+ $(top_srcdir)/m4macros/ltversion.m4 \
+ $(top_srcdir)/m4macros/lt~obsolete.m4 \
+ $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+@HAVE_GTEST_TRUE@am__EXEEXT_1 = hook_load_unittests$(EXEEXT)
+PROGRAMS = $(noinst_PROGRAMS)
+am__hook_load_unittests_SOURCES_DIST = load_unload_unittests.cc \
+ run_unittests.cc
+@HAVE_GTEST_TRUE@am_hook_load_unittests_OBJECTS = hook_load_unittests-load_unload_unittests.$(OBJEXT) \
+@HAVE_GTEST_TRUE@ hook_load_unittests-run_unittests.$(OBJEXT)
+hook_load_unittests_OBJECTS = $(am_hook_load_unittests_OBJECTS)
+am__DEPENDENCIES_1 =
+@HAVE_GTEST_TRUE@hook_load_unittests_DEPENDENCIES = $(top_builddir)/src/lib/dhcpsrv/libkea-dhcpsrv.la \
+@HAVE_GTEST_TRUE@ $(top_builddir)/src/lib/process/libkea-process.la \
+@HAVE_GTEST_TRUE@ $(top_builddir)/src/lib/eval/libkea-eval.la \
+@HAVE_GTEST_TRUE@ $(top_builddir)/src/lib/dhcp_ddns/libkea-dhcp_ddns.la \
+@HAVE_GTEST_TRUE@ $(top_builddir)/src/lib/stats/libkea-stats.la \
+@HAVE_GTEST_TRUE@ $(top_builddir)/src/lib/config/libkea-cfgclient.la \
+@HAVE_GTEST_TRUE@ $(top_builddir)/src/lib/http/libkea-http.la \
+@HAVE_GTEST_TRUE@ $(top_builddir)/src/lib/dhcp/libkea-dhcp++.la \
+@HAVE_GTEST_TRUE@ $(top_builddir)/src/lib/hooks/libkea-hooks.la \
+@HAVE_GTEST_TRUE@ $(top_builddir)/src/lib/database/libkea-database.la \
+@HAVE_GTEST_TRUE@ $(top_builddir)/src/lib/cc/libkea-cc.la \
+@HAVE_GTEST_TRUE@ $(top_builddir)/src/lib/asiolink/libkea-asiolink.la \
+@HAVE_GTEST_TRUE@ $(top_builddir)/src/lib/dns/libkea-dns++.la \
+@HAVE_GTEST_TRUE@ $(top_builddir)/src/lib/cryptolink/libkea-cryptolink.la \
+@HAVE_GTEST_TRUE@ $(top_builddir)/src/lib/log/libkea-log.la \
+@HAVE_GTEST_TRUE@ $(top_builddir)/src/lib/util/libkea-util.la \
+@HAVE_GTEST_TRUE@ $(top_builddir)/src/lib/exceptions/libkea-exceptions.la \
+@HAVE_GTEST_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+@HAVE_GTEST_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
+AM_V_lt = $(am__v_lt_@AM_V@)
+am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
+am__v_lt_0 = --silent
+am__v_lt_1 =
+hook_load_unittests_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX \
+ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CXXLD) \
+ $(hook_load_unittests_CXXFLAGS) $(CXXFLAGS) \
+ $(hook_load_unittests_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_P = $(am__v_P_@AM_V@)
+am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_@AM_V@)
+am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
+am__v_GEN_0 = @echo " GEN " $@;
+am__v_GEN_1 =
+AM_V_at = $(am__v_at_@AM_V@)
+am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
+am__v_at_0 = @
+am__v_at_1 =
+DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__maybe_remake_depfiles = depfiles
+am__depfiles_remade = \
+ ./$(DEPDIR)/hook_load_unittests-load_unload_unittests.Po \
+ ./$(DEPDIR)/hook_load_unittests-run_unittests.Po
+am__mv = mv -f
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+LTCXXCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) \
+ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+ $(AM_CXXFLAGS) $(CXXFLAGS)
+AM_V_CXX = $(am__v_CXX_@AM_V@)
+am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@)
+am__v_CXX_0 = @echo " CXX " $@;
+am__v_CXX_1 =
+CXXLD = $(CXX)
+CXXLINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \
+ $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_CXXLD = $(am__v_CXXLD_@AM_V@)
+am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@)
+am__v_CXXLD_0 = @echo " CXXLD " $@;
+am__v_CXXLD_1 =
+SOURCES = $(hook_load_unittests_SOURCES)
+DIST_SOURCES = $(am__hook_load_unittests_SOURCES_DIST)
+RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \
+ ctags-recursive dvi-recursive html-recursive info-recursive \
+ install-data-recursive install-dvi-recursive \
+ install-exec-recursive install-html-recursive \
+ install-info-recursive install-pdf-recursive \
+ install-ps-recursive install-recursive installcheck-recursive \
+ installdirs-recursive pdf-recursive ps-recursive \
+ tags-recursive uninstall-recursive
+am__can_run_installinfo = \
+ case $$AM_UPDATE_INFO_DIR in \
+ n|no|NO) false;; \
+ *) (install-info --version) >/dev/null 2>&1;; \
+ esac
+RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
+ distclean-recursive maintainer-clean-recursive
+am__recursive_targets = \
+ $(RECURSIVE_TARGETS) \
+ $(RECURSIVE_CLEAN_TARGETS) \
+ $(am__extra_recursive_targets)
+AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
+ distdir distdir-am
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+# Read a list of newline-separated strings from the standard input,
+# and print each of them once, without duplicates. Input order is
+# *not* preserved.
+am__uniquify_input = $(AWK) '\
+ BEGIN { nonempty = 0; } \
+ { items[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in items) print i; }; } \
+'
+# Make sure the list of sources is unique. This is necessary because,
+# e.g., the same source file might be shared among _SOURCES variables
+# for different programs/libraries.
+am__define_uniq_tagged_files = \
+ list='$(am__tagged_files)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | $(am__uniquify_input)`
+ETAGS = etags
+CTAGS = ctags
+am__tty_colors_dummy = \
+ mgn= red= grn= lgn= blu= brg= std=; \
+ am__color_tests=no
+am__tty_colors = { \
+ $(am__tty_colors_dummy); \
+ if test "X$(AM_COLOR_TESTS)" = Xno; then \
+ am__color_tests=no; \
+ elif test "X$(AM_COLOR_TESTS)" = Xalways; then \
+ am__color_tests=yes; \
+ elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \
+ am__color_tests=yes; \
+ fi; \
+ if test $$am__color_tests = yes; then \
+ red=''; \
+ grn=''; \
+ lgn=''; \
+ blu=''; \
+ mgn=''; \
+ brg=''; \
+ std=''; \
+ fi; \
+}
+DIST_SUBDIRS = $(SUBDIRS)
+am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+am__relativize = \
+ dir0=`pwd`; \
+ sed_first='s,^\([^/]*\)/.*$$,\1,'; \
+ sed_rest='s,^[^/]*/*,,'; \
+ sed_last='s,^.*/\([^/]*\)$$,\1,'; \
+ sed_butlast='s,/*[^/]*$$,,'; \
+ while test -n "$$dir1"; do \
+ first=`echo "$$dir1" | sed -e "$$sed_first"`; \
+ if test "$$first" != "."; then \
+ if test "$$first" = ".."; then \
+ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
+ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
+ else \
+ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
+ if test "$$first2" = "$$first"; then \
+ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
+ else \
+ dir2="../$$dir2"; \
+ fi; \
+ dir0="$$dir0"/"$$first"; \
+ fi; \
+ fi; \
+ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
+ done; \
+ reldir="$$dir2"
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+ASCIIDOC = @ASCIIDOC@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BOOST_INCLUDES = @BOOST_INCLUDES@
+BOOST_LIBS = @BOOST_LIBS@
+BOTAN_TOOL = @BOTAN_TOOL@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CONTRIB_DIR = @CONTRIB_DIR@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CRYPTO_CFLAGS = @CRYPTO_CFLAGS@
+CRYPTO_INCLUDES = @CRYPTO_INCLUDES@
+CRYPTO_LDFLAGS = @CRYPTO_LDFLAGS@
+CRYPTO_LIBS = @CRYPTO_LIBS@
+CRYPTO_PACKAGE = @CRYPTO_PACKAGE@
+CRYPTO_RPATH = @CRYPTO_RPATH@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DISTCHECK_BOOST_CONFIGURE_FLAG = @DISTCHECK_BOOST_CONFIGURE_FLAG@
+DISTCHECK_CONTRIB_CONFIGURE_FLAG = @DISTCHECK_CONTRIB_CONFIGURE_FLAG@
+DISTCHECK_CRYPTO_CONFIGURE_FLAG = @DISTCHECK_CRYPTO_CONFIGURE_FLAG@
+DISTCHECK_GSSAPI_CONFIGURE_FLAG = @DISTCHECK_GSSAPI_CONFIGURE_FLAG@
+DISTCHECK_GTEST_CONFIGURE_FLAG = @DISTCHECK_GTEST_CONFIGURE_FLAG@
+DISTCHECK_KEA_SHELL_CONFIGURE_FLAG = @DISTCHECK_KEA_SHELL_CONFIGURE_FLAG@
+DISTCHECK_LIBYANGCPP_CONFIGURE_FLAG = @DISTCHECK_LIBYANGCPP_CONFIGURE_FLAG@
+DISTCHECK_LIBYANG_CONFIGURE_FLAG = @DISTCHECK_LIBYANG_CONFIGURE_FLAG@
+DISTCHECK_LOG4CPLUS_CONFIGURE_FLAG = @DISTCHECK_LOG4CPLUS_CONFIGURE_FLAG@
+DISTCHECK_MYSQL_CONFIGURE_FLAG = @DISTCHECK_MYSQL_CONFIGURE_FLAG@
+DISTCHECK_PERFDHCP_CONFIGURE_FLAG = @DISTCHECK_PERFDHCP_CONFIGURE_FLAG@
+DISTCHECK_PGSQL_CONFIGURE_FLAG = @DISTCHECK_PGSQL_CONFIGURE_FLAG@
+DISTCHECK_PREMIUM_CONFIGURE_FLAG = @DISTCHECK_PREMIUM_CONFIGURE_FLAG@
+DISTCHECK_SYSREPOCPP_CONFIGURE_FLAG = @DISTCHECK_SYSREPOCPP_CONFIGURE_FLAG@
+DISTCHECK_SYSREPO_CONFIGURE_FLAG = @DISTCHECK_SYSREPO_CONFIGURE_FLAG@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GENHTML = @GENHTML@
+GREP = @GREP@
+GSSAPI_CFLAGS = @GSSAPI_CFLAGS@
+GSSAPI_LIBS = @GSSAPI_LIBS@
+GTEST_CONFIG = @GTEST_CONFIG@
+GTEST_INCLUDES = @GTEST_INCLUDES@
+GTEST_LDADD = @GTEST_LDADD@
+GTEST_LDFLAGS = @GTEST_LDFLAGS@
+GTEST_SOURCE = @GTEST_SOURCE@
+HAVE_NETCONF = @HAVE_NETCONF@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+KEA_CXXFLAGS = @KEA_CXXFLAGS@
+KEA_SRCID = @KEA_SRCID@
+KRB5_CONFIG = @KRB5_CONFIG@
+LCOV = @LCOV@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LEX = @LEX@
+LEXLIB = @LEXLIB@
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIBYANGCPP_CPPFLAGS = @LIBYANGCPP_CPPFLAGS@
+LIBYANGCPP_INCLUDEDIR = @LIBYANGCPP_INCLUDEDIR@
+LIBYANGCPP_LIBS = @LIBYANGCPP_LIBS@
+LIBYANGCPP_PREFIX = @LIBYANGCPP_PREFIX@
+LIBYANGCPP_VERSION = @LIBYANGCPP_VERSION@
+LIBYANG_CPPFLAGS = @LIBYANG_CPPFLAGS@
+LIBYANG_INCLUDEDIR = @LIBYANG_INCLUDEDIR@
+LIBYANG_LIBS = @LIBYANG_LIBS@
+LIBYANG_PREFIX = @LIBYANG_PREFIX@
+LIBYANG_VERSION = @LIBYANG_VERSION@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LOG4CPLUS_INCLUDES = @LOG4CPLUS_INCLUDES@
+LOG4CPLUS_LIBS = @LOG4CPLUS_LIBS@
+LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+MYSQL_CPPFLAGS = @MYSQL_CPPFLAGS@
+MYSQL_LIBS = @MYSQL_LIBS@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PACKAGE_VERSION_TYPE = @PACKAGE_VERSION_TYPE@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PDFLATEX = @PDFLATEX@
+PERL = @PERL@
+PGSQL_CPPFLAGS = @PGSQL_CPPFLAGS@
+PGSQL_LIBS = @PGSQL_LIBS@
+PKGPYTHONDIR = @PKGPYTHONDIR@
+PKG_CONFIG = @PKG_CONFIG@
+PLANTUML = @PLANTUML@
+PREMIUM_DIR = @PREMIUM_DIR@
+PYTHON = @PYTHON@
+PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
+PYTHON_PLATFORM = @PYTHON_PLATFORM@
+PYTHON_PREFIX = @PYTHON_PREFIX@
+PYTHON_VERSION = @PYTHON_VERSION@
+RANLIB = @RANLIB@
+SED = @SED@
+SEP = @SEP@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SPHINXBUILD = @SPHINXBUILD@
+SRPD_PLUGINS_PATH = @SRPD_PLUGINS_PATH@
+SR_PLUGINS_PATH = @SR_PLUGINS_PATH@
+SR_REPO_PATH = @SR_REPO_PATH@
+STRIP = @STRIP@
+SYSREPOCPP_CPPFLAGS = @SYSREPOCPP_CPPFLAGS@
+SYSREPOCPP_INCLUDEDIR = @SYSREPOCPP_INCLUDEDIR@
+SYSREPOCPP_LIBS = @SYSREPOCPP_LIBS@
+SYSREPOCPP_PREFIX = @SYSREPOCPP_PREFIX@
+SYSREPOCPP_VERSION = @SYSREPOCPP_VERSION@
+SYSREPO_CPPFLAGS = @SYSREPO_CPPFLAGS@
+SYSREPO_INCLUDEDIR = @SYSREPO_INCLUDEDIR@
+SYSREPO_LIBS = @SYSREPO_LIBS@
+SYSREPO_PREFIX = @SYSREPO_PREFIX@
+SYSREPO_VERSION = @SYSREPO_VERSION@
+USE_LCOV = @USE_LCOV@
+VALGRIND = @VALGRIND@
+VERSION = @VERSION@
+WARNING_GCC_44_STRICT_ALIASING_CFLAG = @WARNING_GCC_44_STRICT_ALIASING_CFLAG@
+YACC = @YACC@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+pkgpyexecdir = @pkgpyexecdir@
+pkgpythondir = @pkgpythondir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+pyexecdir = @pyexecdir@
+pythondir = @pythondir@
+runstatedir = @runstatedir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+SUBDIRS = .
+AM_CPPFLAGS = -I$(top_builddir)/src/lib -I$(top_srcdir)/src/lib \
+ -I$(top_builddir)/src/hooks/dhcp/stat_cmds \
+ -I$(top_srcdir)/src/hooks/dhcp/stat_cmds $(BOOST_INCLUDES) \
+ -DLIBDHCP_STAT_CMDS_SO=\"$(abs_top_builddir)/src/hooks/dhcp/stat_cmds/.libs/libdhcp_stat_cmds.so\"
+AM_CXXFLAGS = $(KEA_CXXFLAGS)
+@USE_STATIC_LINK_TRUE@AM_LDFLAGS = -static
+EXTRA_DIST =
+CLEANFILES = *.gcno *.gcda
+TESTS_ENVIRONMENT = \
+ $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND)
+
+@HAVE_GTEST_TRUE@hook_load_unittests_SOURCES = \
+@HAVE_GTEST_TRUE@ load_unload_unittests.cc run_unittests.cc
+@HAVE_GTEST_TRUE@hook_load_unittests_CPPFLAGS = $(AM_CPPFLAGS) $(GTEST_INCLUDES) $(LOG4CPLUS_INCLUDES)
+@HAVE_GTEST_TRUE@hook_load_unittests_CXXFLAGS = $(AM_CXXFLAGS)
+@HAVE_GTEST_TRUE@hook_load_unittests_LDFLAGS = $(AM_LDFLAGS) $(GTEST_LDFLAGS)
+@HAVE_GTEST_TRUE@hook_load_unittests_LDADD = $(top_builddir)/src/lib/dhcpsrv/libkea-dhcpsrv.la \
+@HAVE_GTEST_TRUE@ $(top_builddir)/src/lib/process/libkea-process.la \
+@HAVE_GTEST_TRUE@ $(top_builddir)/src/lib/eval/libkea-eval.la \
+@HAVE_GTEST_TRUE@ $(top_builddir)/src/lib/dhcp_ddns/libkea-dhcp_ddns.la \
+@HAVE_GTEST_TRUE@ $(top_builddir)/src/lib/stats/libkea-stats.la \
+@HAVE_GTEST_TRUE@ $(top_builddir)/src/lib/config/libkea-cfgclient.la \
+@HAVE_GTEST_TRUE@ $(top_builddir)/src/lib/http/libkea-http.la \
+@HAVE_GTEST_TRUE@ $(top_builddir)/src/lib/dhcp/libkea-dhcp++.la \
+@HAVE_GTEST_TRUE@ $(top_builddir)/src/lib/hooks/libkea-hooks.la \
+@HAVE_GTEST_TRUE@ $(top_builddir)/src/lib/database/libkea-database.la \
+@HAVE_GTEST_TRUE@ $(top_builddir)/src/lib/cc/libkea-cc.la \
+@HAVE_GTEST_TRUE@ $(top_builddir)/src/lib/asiolink/libkea-asiolink.la \
+@HAVE_GTEST_TRUE@ $(top_builddir)/src/lib/dns/libkea-dns++.la \
+@HAVE_GTEST_TRUE@ $(top_builddir)/src/lib/cryptolink/libkea-cryptolink.la \
+@HAVE_GTEST_TRUE@ $(top_builddir)/src/lib/log/libkea-log.la \
+@HAVE_GTEST_TRUE@ $(top_builddir)/src/lib/util/libkea-util.la \
+@HAVE_GTEST_TRUE@ $(top_builddir)/src/lib/exceptions/libkea-exceptions.la \
+@HAVE_GTEST_TRUE@ $(LOG4CPLUS_LIBS) $(CRYPTO_LIBS) \
+@HAVE_GTEST_TRUE@ $(BOOST_LIBS) $(GTEST_LDADD)
+all: all-recursive
+
+.SUFFIXES:
+.SUFFIXES: .cc .lo .o .obj
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+ && { if test -f $@; then exit 0; else break; fi; }; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/hooks/dhcp/stat_cmds/libloadtests/Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --foreign src/hooks/dhcp/stat_cmds/libloadtests/Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+
+clean-noinstPROGRAMS:
+ @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \
+ echo " rm -f" $$list; \
+ rm -f $$list || exit $$?; \
+ test -n "$(EXEEXT)" || exit 0; \
+ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
+ echo " rm -f" $$list; \
+ rm -f $$list
+
+hook_load_unittests$(EXEEXT): $(hook_load_unittests_OBJECTS) $(hook_load_unittests_DEPENDENCIES) $(EXTRA_hook_load_unittests_DEPENDENCIES)
+ @rm -f hook_load_unittests$(EXEEXT)
+ $(AM_V_CXXLD)$(hook_load_unittests_LINK) $(hook_load_unittests_OBJECTS) $(hook_load_unittests_LDADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hook_load_unittests-load_unload_unittests.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hook_load_unittests-run_unittests.Po@am__quote@ # am--include-marker
+
+$(am__depfiles_remade):
+ @$(MKDIR_P) $(@D)
+ @echo '# dummy' >$@-t && $(am__mv) $@-t $@
+
+am--depfiles: $(am__depfiles_remade)
+
+.cc.o:
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $<
+
+.cc.obj:
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cc.lo:
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LTCXXCOMPILE) -c -o $@ $<
+
+hook_load_unittests-load_unload_unittests.o: load_unload_unittests.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(hook_load_unittests_CPPFLAGS) $(CPPFLAGS) $(hook_load_unittests_CXXFLAGS) $(CXXFLAGS) -MT hook_load_unittests-load_unload_unittests.o -MD -MP -MF $(DEPDIR)/hook_load_unittests-load_unload_unittests.Tpo -c -o hook_load_unittests-load_unload_unittests.o `test -f 'load_unload_unittests.cc' || echo '$(srcdir)/'`load_unload_unittests.cc
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/hook_load_unittests-load_unload_unittests.Tpo $(DEPDIR)/hook_load_unittests-load_unload_unittests.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='load_unload_unittests.cc' object='hook_load_unittests-load_unload_unittests.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(hook_load_unittests_CPPFLAGS) $(CPPFLAGS) $(hook_load_unittests_CXXFLAGS) $(CXXFLAGS) -c -o hook_load_unittests-load_unload_unittests.o `test -f 'load_unload_unittests.cc' || echo '$(srcdir)/'`load_unload_unittests.cc
+
+hook_load_unittests-load_unload_unittests.obj: load_unload_unittests.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(hook_load_unittests_CPPFLAGS) $(CPPFLAGS) $(hook_load_unittests_CXXFLAGS) $(CXXFLAGS) -MT hook_load_unittests-load_unload_unittests.obj -MD -MP -MF $(DEPDIR)/hook_load_unittests-load_unload_unittests.Tpo -c -o hook_load_unittests-load_unload_unittests.obj `if test -f 'load_unload_unittests.cc'; then $(CYGPATH_W) 'load_unload_unittests.cc'; else $(CYGPATH_W) '$(srcdir)/load_unload_unittests.cc'; fi`
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/hook_load_unittests-load_unload_unittests.Tpo $(DEPDIR)/hook_load_unittests-load_unload_unittests.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='load_unload_unittests.cc' object='hook_load_unittests-load_unload_unittests.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(hook_load_unittests_CPPFLAGS) $(CPPFLAGS) $(hook_load_unittests_CXXFLAGS) $(CXXFLAGS) -c -o hook_load_unittests-load_unload_unittests.obj `if test -f 'load_unload_unittests.cc'; then $(CYGPATH_W) 'load_unload_unittests.cc'; else $(CYGPATH_W) '$(srcdir)/load_unload_unittests.cc'; fi`
+
+hook_load_unittests-run_unittests.o: run_unittests.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(hook_load_unittests_CPPFLAGS) $(CPPFLAGS) $(hook_load_unittests_CXXFLAGS) $(CXXFLAGS) -MT hook_load_unittests-run_unittests.o -MD -MP -MF $(DEPDIR)/hook_load_unittests-run_unittests.Tpo -c -o hook_load_unittests-run_unittests.o `test -f 'run_unittests.cc' || echo '$(srcdir)/'`run_unittests.cc
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/hook_load_unittests-run_unittests.Tpo $(DEPDIR)/hook_load_unittests-run_unittests.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='run_unittests.cc' object='hook_load_unittests-run_unittests.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(hook_load_unittests_CPPFLAGS) $(CPPFLAGS) $(hook_load_unittests_CXXFLAGS) $(CXXFLAGS) -c -o hook_load_unittests-run_unittests.o `test -f 'run_unittests.cc' || echo '$(srcdir)/'`run_unittests.cc
+
+hook_load_unittests-run_unittests.obj: run_unittests.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(hook_load_unittests_CPPFLAGS) $(CPPFLAGS) $(hook_load_unittests_CXXFLAGS) $(CXXFLAGS) -MT hook_load_unittests-run_unittests.obj -MD -MP -MF $(DEPDIR)/hook_load_unittests-run_unittests.Tpo -c -o hook_load_unittests-run_unittests.obj `if test -f 'run_unittests.cc'; then $(CYGPATH_W) 'run_unittests.cc'; else $(CYGPATH_W) '$(srcdir)/run_unittests.cc'; fi`
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/hook_load_unittests-run_unittests.Tpo $(DEPDIR)/hook_load_unittests-run_unittests.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='run_unittests.cc' object='hook_load_unittests-run_unittests.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(hook_load_unittests_CPPFLAGS) $(CPPFLAGS) $(hook_load_unittests_CXXFLAGS) $(CXXFLAGS) -c -o hook_load_unittests-run_unittests.obj `if test -f 'run_unittests.cc'; then $(CYGPATH_W) 'run_unittests.cc'; else $(CYGPATH_W) '$(srcdir)/run_unittests.cc'; fi`
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run 'make' without going through this Makefile.
+# To change the values of 'make' variables: instead of editing Makefiles,
+# (1) if the variable is set in 'config.status', edit 'config.status'
+# (which will cause the Makefiles to be regenerated when you run 'make');
+# (2) otherwise, pass the desired values on the 'make' command line.
+$(am__recursive_targets):
+ @fail=; \
+ if $(am__make_keepgoing); then \
+ failcom='fail=yes'; \
+ else \
+ failcom='exit 1'; \
+ fi; \
+ dot_seen=no; \
+ target=`echo $@ | sed s/-recursive//`; \
+ case "$@" in \
+ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+ *) list='$(SUBDIRS)' ;; \
+ esac; \
+ for subdir in $$list; do \
+ echo "Making $$target in $$subdir"; \
+ if test "$$subdir" = "."; then \
+ dot_seen=yes; \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || eval $$failcom; \
+ done; \
+ if test "$$dot_seen" = "no"; then \
+ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+ fi; test -z "$$fail"
+
+ID: $(am__tagged_files)
+ $(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-recursive
+TAGS: tags
+
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+ set x; \
+ here=`pwd`; \
+ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+ include_option=--etags-include; \
+ empty_fix=.; \
+ else \
+ include_option=--include; \
+ empty_fix=; \
+ fi; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ test ! -f $$subdir/TAGS || \
+ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
+ fi; \
+ done; \
+ $(am__define_uniq_tagged_files); \
+ shift; \
+ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ if test $$# -gt 0; then \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ "$$@" $$unique; \
+ else \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$unique; \
+ fi; \
+ fi
+ctags: ctags-recursive
+
+CTAGS: ctags
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+ $(am__define_uniq_tagged_files); \
+ test -z "$(CTAGS_ARGS)$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && $(am__cd) $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) "$$here"
+cscopelist: cscopelist-recursive
+
+cscopelist-am: $(am__tagged_files)
+ list='$(am__tagged_files)'; \
+ case "$(srcdir)" in \
+ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+ *) sdir=$(subdir)/$(srcdir) ;; \
+ esac; \
+ for i in $$list; do \
+ if test -f "$$i"; then \
+ echo "$(subdir)/$$i"; \
+ else \
+ echo "$$sdir/$$i"; \
+ fi; \
+ done >> $(top_builddir)/cscope.files
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+check-TESTS: $(TESTS)
+ @failed=0; all=0; xfail=0; xpass=0; skip=0; \
+ srcdir=$(srcdir); export srcdir; \
+ list=' $(TESTS) '; \
+ $(am__tty_colors); \
+ if test -n "$$list"; then \
+ for tst in $$list; do \
+ if test -f ./$$tst; then dir=./; \
+ elif test -f $$tst; then dir=; \
+ else dir="$(srcdir)/"; fi; \
+ if $(TESTS_ENVIRONMENT) $${dir}$$tst $(AM_TESTS_FD_REDIRECT); then \
+ all=`expr $$all + 1`; \
+ case " $(XFAIL_TESTS) " in \
+ *[\ \ ]$$tst[\ \ ]*) \
+ xpass=`expr $$xpass + 1`; \
+ failed=`expr $$failed + 1`; \
+ col=$$red; res=XPASS; \
+ ;; \
+ *) \
+ col=$$grn; res=PASS; \
+ ;; \
+ esac; \
+ elif test $$? -ne 77; then \
+ all=`expr $$all + 1`; \
+ case " $(XFAIL_TESTS) " in \
+ *[\ \ ]$$tst[\ \ ]*) \
+ xfail=`expr $$xfail + 1`; \
+ col=$$lgn; res=XFAIL; \
+ ;; \
+ *) \
+ failed=`expr $$failed + 1`; \
+ col=$$red; res=FAIL; \
+ ;; \
+ esac; \
+ else \
+ skip=`expr $$skip + 1`; \
+ col=$$blu; res=SKIP; \
+ fi; \
+ echo "$${col}$$res$${std}: $$tst"; \
+ done; \
+ if test "$$all" -eq 1; then \
+ tests="test"; \
+ All=""; \
+ else \
+ tests="tests"; \
+ All="All "; \
+ fi; \
+ if test "$$failed" -eq 0; then \
+ if test "$$xfail" -eq 0; then \
+ banner="$$All$$all $$tests passed"; \
+ else \
+ if test "$$xfail" -eq 1; then failures=failure; else failures=failures; fi; \
+ banner="$$All$$all $$tests behaved as expected ($$xfail expected $$failures)"; \
+ fi; \
+ else \
+ if test "$$xpass" -eq 0; then \
+ banner="$$failed of $$all $$tests failed"; \
+ else \
+ if test "$$xpass" -eq 1; then passes=pass; else passes=passes; fi; \
+ banner="$$failed of $$all $$tests did not behave as expected ($$xpass unexpected $$passes)"; \
+ fi; \
+ fi; \
+ dashes="$$banner"; \
+ skipped=""; \
+ if test "$$skip" -ne 0; then \
+ if test "$$skip" -eq 1; then \
+ skipped="($$skip test was not run)"; \
+ else \
+ skipped="($$skip tests were not run)"; \
+ fi; \
+ test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \
+ dashes="$$skipped"; \
+ fi; \
+ report=""; \
+ if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \
+ report="Please report to $(PACKAGE_BUGREPORT)"; \
+ test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \
+ dashes="$$report"; \
+ fi; \
+ dashes=`echo "$$dashes" | sed s/./=/g`; \
+ if test "$$failed" -eq 0; then \
+ col="$$grn"; \
+ else \
+ col="$$red"; \
+ fi; \
+ echo "$${col}$$dashes$${std}"; \
+ echo "$${col}$$banner$${std}"; \
+ test -z "$$skipped" || echo "$${col}$$skipped$${std}"; \
+ test -z "$$report" || echo "$${col}$$report$${std}"; \
+ echo "$${col}$$dashes$${std}"; \
+ test "$$failed" -eq 0; \
+ else :; fi
+
+distdir: $(BUILT_SOURCES)
+ $(MAKE) $(AM_MAKEFLAGS) distdir-am
+
+distdir-am: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d "$(distdir)/$$file"; then \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+ else \
+ test -f "$(distdir)/$$file" \
+ || cp -p $$d/$$file "$(distdir)/$$file" \
+ || exit 1; \
+ fi; \
+ done
+ @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ $(am__make_dryrun) \
+ || test -d "$(distdir)/$$subdir" \
+ || $(MKDIR_P) "$(distdir)/$$subdir" \
+ || exit 1; \
+ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
+ $(am__relativize); \
+ new_distdir=$$reldir; \
+ dir1=$$subdir; dir2="$(top_distdir)"; \
+ $(am__relativize); \
+ new_top_distdir=$$reldir; \
+ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
+ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
+ ($(am__cd) $$subdir && \
+ $(MAKE) $(AM_MAKEFLAGS) \
+ top_distdir="$$new_top_distdir" \
+ distdir="$$new_distdir" \
+ am__remove_distdir=: \
+ am__skip_length_check=: \
+ am__skip_mode_fix=: \
+ distdir) \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+ $(MAKE) $(AM_MAKEFLAGS) check-TESTS
+check: check-recursive
+all-am: Makefile $(PROGRAMS)
+installdirs: installdirs-recursive
+installdirs-am:
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+ if test -z '$(STRIP)'; then \
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ install; \
+ else \
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+ fi
+mostlyclean-generic:
+
+clean-generic:
+ -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+ -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
+
+clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \
+ mostlyclean-am
+
+distclean: distclean-recursive
+ -rm -f ./$(DEPDIR)/hook_load_unittests-load_unload_unittests.Po
+ -rm -f ./$(DEPDIR)/hook_load_unittests-run_unittests.Po
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+html-am:
+
+info: info-recursive
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-recursive
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-recursive
+
+install-html-am:
+
+install-info: install-info-recursive
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-recursive
+
+install-pdf-am:
+
+install-ps: install-ps-recursive
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+ -rm -f ./$(DEPDIR)/hook_load_unittests-load_unload_unittests.Po
+ -rm -f ./$(DEPDIR)/hook_load_unittests-run_unittests.Po
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+ mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: $(am__recursive_targets) check-am install-am install-strip
+
+.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \
+ am--depfiles check check-TESTS check-am clean clean-generic \
+ clean-libtool clean-noinstPROGRAMS cscopelist-am ctags \
+ ctags-am distclean distclean-compile distclean-generic \
+ distclean-libtool distclean-tags distdir dvi dvi-am html \
+ html-am info info-am install install-am install-data \
+ install-data-am install-dvi install-dvi-am install-exec \
+ install-exec-am install-html install-html-am install-info \
+ install-info-am install-man install-pdf install-pdf-am \
+ install-ps install-ps-am install-strip installcheck \
+ installcheck-am installdirs installdirs-am maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-compile \
+ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+ tags tags-am uninstall uninstall-am
+
+.PRECIOUS: Makefile
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/src/hooks/dhcp/stat_cmds/libloadtests/load_unload_unittests.cc b/src/hooks/dhcp/stat_cmds/libloadtests/load_unload_unittests.cc
new file mode 100644
index 0000000..ff3ddf8
--- /dev/null
+++ b/src/hooks/dhcp/stat_cmds/libloadtests/load_unload_unittests.cc
@@ -0,0 +1,64 @@
+// Copyright (C) 2022 Internet Systems Consortium, Inc. ("ISC")
+//
+// This Source Code Form is subject to the terms of the Mozilla Public
+// License, v. 2.0. If a copy of the MPL was not distributed with this
+// file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+/// @file This file contains tests which exercise the load and unload
+/// functions in the ddns tuning hook library. In order to test the load
+/// function, one must be able to pass it hook library parameters. The
+/// the only way to populate these parameters is by actually loading the
+/// library via HooksManager::loadLibraries().
+
+#include <config.h>
+
+#include <cc/data.h>
+#include <dhcpsrv/cfgmgr.h>
+#include <hooks/hooks_manager.h>
+#include <process/daemon.h>
+#include <testutils/gtest_utils.h>
+#include <testutils/lib_load_test_fixture.h>
+
+#include <gtest/gtest.h>
+#include <errno.h>
+
+using namespace std;
+using namespace isc;
+using namespace isc::hooks;
+using namespace isc::data;
+using namespace isc::dhcp;
+using namespace isc::process;
+
+namespace {
+
+/// @brief Test fixture for testing loading and unloading the stat cmds library
+class StatCmdsCbLibLoadTest : public isc::test::LibLoadTest {
+public:
+ /// @brief Constructor
+ StatCmdsCbLibLoadTest() : LibLoadTest(LIBDHCP_STAT_CMDS_SO) {
+ }
+
+ /// @brief Destructor
+ virtual ~StatCmdsCbLibLoadTest() {
+ unloadLibraries();
+ }
+};
+
+// Simple V4 test that checks the library can be loaded and unloaded several times.
+TEST_F(StatCmdsCbLibLoadTest, validLoad4) {
+ validDaemonTest("kea-dhcp4");
+}
+
+// Simple V6 test that checks the library can be loaded and unloaded several times.
+TEST_F(StatCmdsCbLibLoadTest, validLoad6) {
+ validDaemonTest("kea-dhcp6", AF_INET6);
+}
+
+// Simple V6 test that checks the library cannot by loaded by invalid daemons.
+TEST_F(StatCmdsCbLibLoadTest, invalidDaemonLoad) {
+ invalidDaemonTest("kea-ctrl-agent");
+ invalidDaemonTest("kea-dhcp-ddns");
+ invalidDaemonTest("bogus");
+}
+
+} // end of anonymous namespace
diff --git a/src/hooks/dhcp/stat_cmds/libloadtests/run_unittests.cc b/src/hooks/dhcp/stat_cmds/libloadtests/run_unittests.cc
new file mode 100644
index 0000000..d9e195d
--- /dev/null
+++ b/src/hooks/dhcp/stat_cmds/libloadtests/run_unittests.cc
@@ -0,0 +1,20 @@
+// Copyright (C) 2022 Internet Systems Consortium, Inc. ("ISC")
+//
+// This Source Code Form is subject to the terms of the End User License
+// Agreement. See COPYING file in the premium/ directory.
+
+#include <config.h>
+
+#include <log/logger_support.h>
+
+#include <gtest/gtest.h>
+
+int
+main(int argc, char* argv[]) {
+ ::testing::InitGoogleTest(&argc, argv);
+ isc::log::initLogger();
+
+ int result = RUN_ALL_TESTS();
+
+ return (result);
+}
diff --git a/src/hooks/dhcp/stat_cmds/stat_cmds.cc b/src/hooks/dhcp/stat_cmds/stat_cmds.cc
new file mode 100644
index 0000000..e09047f
--- /dev/null
+++ b/src/hooks/dhcp/stat_cmds/stat_cmds.cc
@@ -0,0 +1,769 @@
+// Copyright (C) 2018-2023 Internet Systems Consortium, Inc. ("ISC")
+//
+// This Source Code Form is subject to the terms of the Mozilla Public
+// License, v. 2.0. If a copy of the MPL was not distributed with this
+// file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+#include <config.h>
+#include <config/command_mgr.h>
+#include <config/cmds_impl.h>
+#include <cc/command_interpreter.h>
+#include <cc/data.h>
+#include <dhcpsrv/cfgmgr.h>
+#include <dhcpsrv/lease_mgr.h>
+#include <dhcpsrv/lease_mgr_factory.h>
+#include <dhcpsrv/subnet_id.h>
+#include <hooks/hooks.h>
+#include <exceptions/exceptions.h>
+#include <stat_cmds.h>
+#include <stat_cmds_log.h>
+#include <stats/stats_mgr.h>
+#include <util/boost_time_utils.h>
+#include <util/multi_threading_mgr.h>
+
+#include <boost/date_time/posix_time/posix_time.hpp>
+#include <string>
+
+using namespace isc::dhcp;
+using namespace isc::data;
+using namespace isc::config;
+using namespace isc::asiolink;
+using namespace isc::hooks;
+using namespace isc::stats;
+using namespace isc::util;
+using namespace isc::log;
+using namespace std;
+
+namespace isc {
+namespace stat_cmds {
+
+/// @brief Exception thrown no subnets fall within the selection criteria
+/// This exception is thrown when a valid combination of query parameters
+/// excludes all known (i.e. configured) subnets.
+class NotFound: public isc::Exception {
+public:
+ NotFound (const char* file, size_t line, const char* what) :
+ isc::Exception(file, line, what) { };
+};
+
+/// @brief Implements command handling for stat-leaseX-get commands
+class LeaseStatCmdsImpl : private CmdsImpl {
+public:
+
+ /// @brief Wrapper class for stat-leaseX-get command parameters.
+ class Parameters {
+ public:
+ /// @brief Specifies the subnet-id for a single subnet, or
+ /// the first subnet for a subnet range
+ SubnetID first_subnet_id_;
+
+ /// @brief Specifies the last subnet for subnet range
+ SubnetID last_subnet_id_;
+
+ /// @brief Denotes the query selection mode all, subnet,
+ /// or subnet range
+ LeaseStatsQuery::SelectMode select_mode_;
+
+ /// @brief Generate a string version of the contents
+ std::string toText() {
+ std::stringstream os;
+ switch (select_mode_) {
+ case LeaseStatsQuery::ALL_SUBNETS:
+ os << "[all subnets]";
+ break;
+ case LeaseStatsQuery::SINGLE_SUBNET:
+ os << "[subnet-id=" << first_subnet_id_ << "]";
+ break;
+ case LeaseStatsQuery::SUBNET_RANGE:
+ os << "[subnets " << first_subnet_id_
+ << " through " << last_subnet_id_ << "]";
+ break;
+ default:
+ os << "unsupported";
+ }
+
+ return (os.str());
+ }
+ };
+
+public:
+
+ /// @brief Provides the implementation for stat-lease4-get,
+ /// @ref isc::stat_cmds::StatCmds::statLease4GetHandler
+ ///
+ /// It parses the command arguments, and then invokes makeResult4()
+ /// to fulfil the lease4 statistics fetch. It then constructs the outbound
+ /// response based on those results. If a NotFound exception is caught,
+ /// a CONTROL_RESULT_EMTPY response is generated.
+ ///
+ /// @param handle Callout context - which is expected to contain the
+ /// command JSON text in the "command" argument
+ /// @return 0 upon success, non-zero otherwise
+ int
+ statLease4GetHandler(CalloutHandle& handle);
+
+ /// @brief Provides the implementation for stat-lease6-get,
+ /// @ref isc::stat_cmds::StatCmds::statLease6GetHandler
+ ///
+ /// It parses the command arguments, and then invokes makeResult6()
+ /// to fulfil the lease6 statistics fetch. It then constructs the outbound
+ /// response based on those results. If a NotFound exception is caught,
+ /// a CONTROL_RESULT_EMTPY response is generated.
+ ///
+ /// @param handle Callout context - which is expected to contain the
+ /// command JSON text in the "command" argument
+ /// @return 0 upon success, non-zero otherwise
+ int
+ statLease6GetHandler(CalloutHandle& handle);
+
+ /// @brief Parses command arguments into stat-leaseX-get parameters
+ /// @param cmd_args Element form of command arguments to parse
+ /// @throw BadValue if any of the following rules are broken:
+ ///
+ /// -# If subnet-id is specified it must be an integer > 0
+ /// -# If subnet-range is specified it must contain both
+ /// first-subnet-id and last-subnet-id and their values
+ /// must fulfill: 0 < first-subnet-id < last-subnet-id
+ /// -# subnet-id and subnet-range are mutually exclusive
+ Parameters getParameters(const ConstElementPtr& cmd_args);
+
+ /// @brief Executes the lease4 query and constructs the outbound result set
+ ///
+ /// This method uses the command parameters to identify the range
+ /// of configured subnets. If the range contains no known subnets
+ /// then a NotFound exception is thrown. Having determined the range
+ /// to be valid, it then executes the appropriate Lease4 stats query via
+ /// the LeaseMgr.
+ ///
+ /// Lastly, it iterates over the qualifying subnets adding a row
+ /// of statistics for each one to the result-set. Each row combines
+ /// the totals from StatsMgr with the type and state counts from the
+ /// query results. For subnets with no query data (i.e. no leases),
+ /// their rows have non-zero values for totals only.
+ ///
+ /// @param result Element to which the constructed result-set will be added.
+ /// @param params Parsed stat-lease4-cmd parameters
+ /// @throw NotFound if the selection criteria eliminates all known subnets
+ uint64_t makeResultSet4(const ElementPtr& result, const Parameters& params);
+
+ /// @brief Executes the lease4 query and constructs the outbound result set
+ /// This method uses the command parameters to identify the range
+ /// of configured subnets. If the range contains no known subnets
+ /// then a NotFound exception is thrown. Having determined the range
+ /// to be valid, it then executes the appropriate Lease6 stats query via
+ /// the LeaseMgr.
+ ///
+ /// Lastly, it iterates over the qualifying subnets adding a row
+ /// of statistics for each one to the result-set. Each row combines
+ /// the totals from StatsMgr with the type and state counts from the
+ /// query results. For subnets with no query data (i.e. no leases),
+ /// their rows have non-zero values for totals only.
+ ///
+ /// @param result Element to which the constructed result-set will be added.
+ /// @param params Parsed stat-lease6-cmd parameters
+ /// @throw NotFound if the selection criteria eliminates all known subnets
+ uint64_t makeResultSet6(const ElementPtr& result, const Parameters& params);
+
+ /// @brief Instantiates a new "empty" result-set Element
+ ///
+ /// Constructs a ElementPtr tree of an empty result set
+ /// for holding rows of the given column labels. In JSON
+ /// it appears as follows:
+ ///
+ /// "result-set": {
+ /// "timestamp": "2018-03-22 09:43:30.815371",
+ /// "columns": ["<label-1>, <label-2>, ... ],
+ /// "rows": []
+ /// }
+ ///
+ /// And then adds it to the given wrapper element.
+ ///
+ /// @param wrapper Element to which the newly constructed result-set
+ /// will be added.
+ /// @param column_labels list of the column labels in the order the values
+ /// for each column will appear in the result-set rows
+ /// @return A reference to the writable list of rows of the result-set
+ ElementPtr createResultSet(const ElementPtr& wrapper,
+ const std::vector<std::string>& column_labels);
+
+ /// @brief Adds a row of Lease4 stat values to a list of value rows
+ ///
+ /// @param[out] value_rows list of rows to which to add
+ /// @param[out] subnet_id id of the subnet of the new row. This value is
+ /// also used for fetching the total addresses in the subnet
+ /// @param assigned number of assigned addresses in the subnet
+ /// @param declined number of declined addresses in the subnet
+ void addValueRow4(ElementPtr value_rows, const SubnetID &subnet_id,
+ int64_t assigned, int64_t declined);
+
+ /// @brief Adds a row of Lease6 stat values to a list of value rows
+ ///
+ /// @param[out] value_rows list of rows to which to add
+ /// @param[out] subnet_id id of the subnet of the new row. This value is
+ /// also used for fetching the total NAs and PDs in the subnet
+ /// @param assigned number of assigned NAs in the subnet
+ /// @param declined number of declined NAs in the subnet
+ /// @param assigned_pds number of assigned PDs the subnet
+ void addValueRow6(ElementPtr value_rows, const SubnetID &subnet_id,
+ int64_t assigned, int64_t declined, int64_t assigned_pds);
+
+ /// @brief Fetches a single integer statistic for a subnet from StatsMgr.
+ ///
+ /// Uses the given id and name to query the StatsMgr for the desired value.
+ ///
+ /// @param subnet_id the subnet ID for the desired statistic
+ /// @param name the name of the desired statistic
+ int64_t getSubnetStat(const SubnetID& subnet_id, const std::string& name);
+
+ /// @brief Fetches a single bigint statistic for a subnet from StatsMgr.
+ ///
+ /// Uses the given id and name to query the StatsMgr for the desired value.
+ ///
+ /// @param subnet_id the subnet ID for the desired statistic
+ /// @param name the name of the desired statistic
+ int128_t getBigSubnetStat(const SubnetID& subnet_id, const std::string& name);
+};
+
+int
+LeaseStatCmdsImpl::statLease4GetHandler(CalloutHandle& handle) {
+ ElementPtr result = Element::createMap();
+ Parameters params;
+ ConstElementPtr response;
+
+ // Extract the command and then the parameters
+ try {
+ extractCommand(handle);
+ params = getParameters(cmd_args_);
+ } catch (const std::exception& ex) {
+ LOG_ERROR(stat_cmds_logger, STAT_CMDS_LEASE4_GET_INVALID)
+ .arg(ex.what());
+ setErrorResponse(handle, ex.what());
+ return (1);
+ }
+
+ try {
+ // Now build the result set
+ uint64_t rows = makeResultSet4(result, params);
+ LOG_INFO(stat_cmds_logger, STAT_CMDS_LEASE4_GET)
+ .arg(params.toText())
+ .arg(rows);
+ std::stringstream os;
+ os << "stat-lease4-get" << params.toText() << ": " << rows << " rows found";
+ response = createAnswer(CONTROL_RESULT_SUCCESS, os.str(), result);
+ } catch (const NotFound& ex) {
+ // Criteria was valid but included no known subnets,
+ // so we return a not found response.
+ LOG_INFO(stat_cmds_logger, STAT_CMDS_LEASE4_GET_NO_SUBNETS)
+ .arg(params.toText())
+ .arg(ex.what());
+ std::stringstream os;
+ os << "stat-lease4-get" << params.toText() << ": no matching data, " << ex.what();
+ response = createAnswer(CONTROL_RESULT_EMPTY, os.str(), result);
+ } catch (const std::exception& ex) {
+ LOG_ERROR(stat_cmds_logger, STAT_CMDS_LEASE4_GET_FAILED)
+ .arg(params.toText())
+ .arg(ex.what());
+ setErrorResponse(handle, ex.what());
+ return (1);
+ }
+
+ setResponse(handle, response);
+ return (0);
+}
+
+int
+LeaseStatCmdsImpl::statLease6GetHandler(CalloutHandle& handle) {
+ ElementPtr result = Element::createMap();
+ Parameters params;
+ ConstElementPtr response;
+
+ // Extract the command and then the parameters
+ try {
+ extractCommand(handle);
+ params = getParameters(cmd_args_);
+ } catch (const std::exception& ex) {
+ LOG_ERROR(stat_cmds_logger, STAT_CMDS_LEASE6_GET_INVALID)
+ .arg(ex.what());
+ setErrorResponse(handle, ex.what());
+ return (1);
+ }
+
+ try {
+ // Now build the result set
+ uint64_t rows = makeResultSet6(result, params);
+ LOG_INFO(stat_cmds_logger, STAT_CMDS_LEASE6_GET)
+ .arg(params.toText())
+ .arg(rows);
+ std::stringstream os;
+ os << "stat-lease6-get" << params.toText() << ": " << rows << " rows found";
+ response = createAnswer(CONTROL_RESULT_SUCCESS, os.str(), result);
+ } catch (const NotFound& ex) {
+ // Criteria was valid but included no known subnets,
+ // so we return a not found response.
+ LOG_INFO(stat_cmds_logger, STAT_CMDS_LEASE6_GET_NO_SUBNETS)
+ .arg(params.toText())
+ .arg(ex.what());
+ std::stringstream os;
+ os << "stat-lease6-get" << params.toText() << ": no matching data, " << ex.what();
+ response = createAnswer(CONTROL_RESULT_EMPTY, os.str(), result);
+ } catch (const std::exception& ex) {
+ LOG_ERROR(stat_cmds_logger, STAT_CMDS_LEASE6_GET_FAILED)
+ .arg(params.toText())
+ .arg(ex.what());
+ setErrorResponse(handle, ex.what());
+ return (1);
+ }
+
+ setResponse(handle, response);
+ return (0);
+}
+
+LeaseStatCmdsImpl::Parameters
+LeaseStatCmdsImpl::getParameters(const ConstElementPtr& cmd_args) {
+ Parameters params;
+
+ params.select_mode_ = LeaseStatsQuery::ALL_SUBNETS;
+ params.first_subnet_id_ = 0;
+ params.last_subnet_id_ = 0;
+ if (!cmd_args ) {
+ // No arguments defaults to ALL_SUBNETS.
+ return (params);
+ }
+
+ if (cmd_args->getType() != Element::map) {
+ isc_throw(BadValue, "'arguments' parameter is not a map");
+ }
+
+ params.select_mode_ = LeaseStatsQuery::ALL_SUBNETS;
+ if (cmd_args->contains("subnet-id")) {
+
+ ConstElementPtr value = cmd_args->get("subnet-id");
+ if (value->getType() != Element::integer) {
+ isc_throw(BadValue, "'subnet-id' parameter is not integer");
+ }
+
+ if (value->intValue() <= 0) {
+ isc_throw(BadValue, "'subnet-id' parameter must be > 0");
+ }
+
+ params.first_subnet_id_ = value->intValue();
+ params.select_mode_ = LeaseStatsQuery::SINGLE_SUBNET;
+ }
+
+ if (cmd_args->contains("subnet-range")) {
+ if (params.select_mode_ == LeaseStatsQuery::SINGLE_SUBNET) {
+ isc_throw(BadValue, "cannot specify both subnet-id and subnet-range");
+ }
+
+ ConstElementPtr range = cmd_args->get("subnet-range");
+ if (range->getType() != Element::map) {
+ isc_throw(BadValue, "subnet-range parameter is not a map");
+ }
+
+ ConstElementPtr value = range->get("first-subnet-id");
+ if (!value || value->getType() != Element::integer) {
+ isc_throw(BadValue, "'first-subnet-id' parameter missing or not an integer");
+ }
+
+ if (value->intValue() <= 0) {
+ isc_throw(BadValue, "'first-subnet-id' parameter must be > 0");
+ }
+
+ params.first_subnet_id_ = value->intValue();
+
+ value = range->get("last-subnet-id");
+ if (!value || value->getType() != Element::integer) {
+ isc_throw(BadValue, "'last-subnet-id' parameter missing or not an integer");
+ }
+
+ if (value->intValue() <= 0) {
+ isc_throw(BadValue, "'last-subnet-id' parameter must be > 0");
+ }
+
+ params.last_subnet_id_ = value->intValue();
+
+ if (params.last_subnet_id_ < params.first_subnet_id_) {
+ isc_throw(BadValue, "'last-subnet-id' must be greater than 'first-subnet-id'");
+ }
+
+ params.select_mode_ = LeaseStatsQuery::SUBNET_RANGE;
+ }
+
+ return (params);
+}
+
+uint64_t
+LeaseStatCmdsImpl::makeResultSet4(const ElementPtr& result_wrapper,
+ const Parameters& params) {
+ // First we need to determine the range of configured subnets
+ // which meet the selection criteria. If the range contains
+ // no subnets we punt.
+ // Iterate over the selected range of configured subnets generating
+ // a result-set row for each one. If a subnet has data in the query
+ // content use it, otherwise, it gets a row with totals only. This
+ // way we send back a row for every selected subnet.
+ const Subnet4Collection* subnets =
+ CfgMgr::instance().getCurrentCfg()->getCfgSubnets4()->getAll();
+
+ // Set the bounds on the selected subnet range
+ const auto& idx = subnets->get<SubnetSubnetIdIndexTag>();
+
+ // Init to ALL so we can use auto
+ auto lower = idx.begin();
+ auto upper = idx.end();
+ switch (params.select_mode_) {
+ case LeaseStatsQuery::SINGLE_SUBNET:
+ lower = idx.find(params.first_subnet_id_);
+ // If it's an unknown subnet, punt.
+ if (lower == idx.end()) {
+ isc_throw(NotFound, "subnet-id: "
+ << params.first_subnet_id_ << " does not exist");
+ }
+
+ upper = idx.upper_bound(params.first_subnet_id_);
+ break;
+ case LeaseStatsQuery::SUBNET_RANGE:
+ lower = idx.lower_bound(params.first_subnet_id_);
+ upper = idx.upper_bound(params.last_subnet_id_);
+ break;
+ default:
+ break;
+ }
+
+ // If it's an empty range, punt.
+ if (lower == upper) {
+ isc_throw(NotFound, "selected ID range: "
+ << params.first_subnet_id_ << " through "
+ << params.last_subnet_id_ << " includes no known subnets");
+ }
+
+ // Now we can run the stats query.
+ LeaseStatsQueryPtr query;
+ switch (params.select_mode_) {
+ case LeaseStatsQuery::ALL_SUBNETS:
+ query = LeaseMgrFactory::instance().startLeaseStatsQuery4();
+ break;
+ case LeaseStatsQuery::SINGLE_SUBNET:
+ query = LeaseMgrFactory::instance()
+ .startSubnetLeaseStatsQuery4(params.first_subnet_id_);
+ break;
+ case LeaseStatsQuery::SUBNET_RANGE:
+ query = LeaseMgrFactory::instance()
+ .startSubnetRangeLeaseStatsQuery4(params.first_subnet_id_,
+ params.last_subnet_id_);
+ break;
+ default:
+ return (0);
+ }
+
+ // Create the result-set map.
+ // labels could be class statics?
+ std::vector<std::string>column_labels = { "subnet-id", "total-addresses",
+ "cumulative-assigned-addresses",
+ "assigned-addresses",
+ "declined-addresses" };
+ ElementPtr value_rows = createResultSet(result_wrapper, column_labels);
+
+ // Get the first query row
+ LeaseStatsRow query_row;
+ bool query_eof = !(query->getNextRow(query_row));
+
+ // Now we iterate over the selected range, building rows accordingly.
+ bool orphaned_stats = false;
+ for (auto cur_subnet = lower; cur_subnet != upper; ++cur_subnet) {
+ SubnetID cur_id = (*cur_subnet)->getID();
+
+ // Skip any unexpected result set rows. These occur when
+ // subnets no longer exist but either their leases (memfile)
+ // or their leaseX-stat rows (db lease backends) still do.
+ while ((cur_id > query_row.subnet_id_) && (!query_eof)) {
+ orphaned_stats = true;
+ query_eof = !(query->getNextRow(query_row));
+ }
+
+ // Add total only rows for subnets that occur before
+ // or after the subnets in the query content. These are
+ // subnets which exist but for which there is not yet any
+ // lease data.
+ if ((cur_id < query_row.subnet_id_) || (query_eof)) {
+ // Generate a totals only row
+ addValueRow4(value_rows, cur_id, 0, 0);
+ continue;
+ }
+
+ // Current subnet matches query row, so iterate over its
+ // query rows (one per state) and accumulate them
+ // into a result-set row.
+ int64_t assigned = 0;
+ int64_t declined = 0;
+ bool add_row = false;
+ while (!query_eof && (query_row.subnet_id_ == cur_id)) {
+ if (query_row.lease_state_ == Lease::STATE_DEFAULT) {
+ add_row = true;
+ assigned = query_row.state_count_;
+ } else if (query_row.lease_state_ == Lease::STATE_DECLINED) {
+ add_row = true;
+ declined = query_row.state_count_;
+ }
+
+ // Get next query row
+ query_eof = !(query->getNextRow(query_row));
+ }
+ // Add the row for the current subnet
+ if (add_row) {
+ addValueRow4(value_rows, cur_id, assigned, declined);
+ }
+ }
+
+ // If there are any orphaned statistics log it.
+ if (!(query_eof) || orphaned_stats) {
+ LOG_DEBUG(stat_cmds_logger, DBGLVL_TRACE_BASIC, STAT_CMDS_LEASE4_ORPHANED_STATS);
+ }
+
+ return (value_rows->size());
+}
+
+uint64_t
+LeaseStatCmdsImpl::makeResultSet6(const ElementPtr& result_wrapper,
+ const Parameters& params) {
+ // First we need to determine the range of configured subnets
+ // which meet the selection criteria. If the range contains
+ // no subnets we punt.
+ // Iterate over the selected range of configured subnets generating
+ // a result-set row for each one. If a subnet has data in the query
+ // content use it, otherwise, it gets a row with totals only. This
+ // way we send back a row for every selected subnet.
+ const Subnet6Collection* subnets =
+ CfgMgr::instance().getCurrentCfg()->getCfgSubnets6()->getAll();
+
+ // Set the bounds on the selected subnet range
+ const auto& idx = subnets->get<SubnetSubnetIdIndexTag>();
+
+ // Init to ALL so we can use auto
+ auto lower = idx.begin();
+ auto upper = idx.end();
+ switch (params.select_mode_) {
+ case LeaseStatsQuery::SINGLE_SUBNET:
+ lower = idx.find(params.first_subnet_id_);
+ // If it's an unknown subnet, punt.
+ if (lower == idx.end()) {
+ isc_throw(NotFound, "subnet-id: "
+ << params.first_subnet_id_ << " does not exist");
+ }
+
+ upper = idx.upper_bound(params.first_subnet_id_);
+ break;
+ case LeaseStatsQuery::SUBNET_RANGE:
+ lower = idx.lower_bound(params.first_subnet_id_);
+ upper = idx.upper_bound(params.last_subnet_id_);
+ break;
+ default:
+ break;
+ }
+
+ // If it's an empty range, punt.
+ if (lower == upper) {
+ isc_throw(NotFound, "selected ID range: "
+ << params.first_subnet_id_ << " through "
+ << params.last_subnet_id_ << " includes no known subnets");
+ }
+
+ // Now we can run the stats query.
+ LeaseStatsQueryPtr query;
+ switch (params.select_mode_) {
+ case LeaseStatsQuery::ALL_SUBNETS:
+ query = LeaseMgrFactory::instance().startLeaseStatsQuery6();
+ break;
+ case LeaseStatsQuery::SINGLE_SUBNET:
+ query = LeaseMgrFactory::instance()
+ .startSubnetLeaseStatsQuery6(params.first_subnet_id_);
+ break;
+ case LeaseStatsQuery::SUBNET_RANGE:
+ query = LeaseMgrFactory::instance()
+ .startSubnetRangeLeaseStatsQuery6(params.first_subnet_id_,
+ params.last_subnet_id_);
+ break;
+ default:
+ return (0);
+ }
+
+ // Create the result-set map.
+ // labels could be class statics?
+ std::vector<std::string>column_labels = { "subnet-id", "total-nas",
+ "cumulative-assigned-nas",
+ "assigned-nas",
+ "declined-addresses", "total-pds",
+ "cumulative-assigned-pds",
+ "assigned-pds" };
+ ElementPtr value_rows = createResultSet(result_wrapper, column_labels);
+
+ // Get the first query row
+ LeaseStatsRow query_row;
+ bool query_eof = !(query->getNextRow(query_row));
+
+ // Now we iterate over the selected range, building rows accordingly.
+ bool orphaned_stats = false;
+ for (auto cur_subnet = lower; cur_subnet != upper; ++cur_subnet) {
+ SubnetID cur_id = (*cur_subnet)->getID();
+
+ // Skip any unexpected result set rows. These occur when
+ // subnets no longer exist but either their leases (memfile)
+ // or their leaseX-stat rows (db lease backends) still do.
+ while ((cur_id > query_row.subnet_id_) && (!query_eof)) {
+ orphaned_stats = true;
+ query_eof = !(query->getNextRow(query_row));
+ }
+
+ // Add total only rows for subnets that occur before
+ // or after the subnets in the query content. These are
+ // subnets which exist but for which there is not yet any
+ // lease data.
+ if ((cur_id < query_row.subnet_id_) || (query_eof)) {
+ // Generate a totals only row
+ addValueRow6(value_rows, cur_id, 0, 0, 0);
+ continue;
+ }
+
+ // Current subnet matches query row, so iterate over its
+ // query rows (one per state) and accumulate them
+ // into a result-set row.
+ int64_t assigned = 0;
+ int64_t declined = 0;
+ int64_t assigned_pds = 0;
+ bool add_row = false;
+ while (!query_eof && (query_row.subnet_id_ == cur_id)) {
+ if (query_row.lease_state_ == Lease::STATE_DEFAULT) {
+ add_row = true;
+ if (query_row.lease_type_ == Lease::TYPE_NA) {
+ assigned = query_row.state_count_;
+ } else {
+ assigned_pds = query_row.state_count_;
+ }
+ } else if (query_row.lease_state_ == Lease::STATE_DECLINED) {
+ add_row = true;
+ declined = query_row.state_count_;
+ }
+
+ // Get next query row
+ query_eof = !(query->getNextRow(query_row));
+ }
+ // Add the row for the current subnet
+ if (add_row) {
+ addValueRow6(value_rows, cur_id, assigned, declined, assigned_pds);
+ }
+ }
+
+ // If there are any orphaned statistics log it.
+ if (!(query_eof) || orphaned_stats) {
+ LOG_DEBUG(stat_cmds_logger, DBGLVL_TRACE_BASIC, STAT_CMDS_LEASE6_ORPHANED_STATS);
+ }
+
+ return (value_rows->size());
+}
+
+ElementPtr
+LeaseStatCmdsImpl::createResultSet(const ElementPtr &result_wrapper,
+ const std::vector<std::string>& column_labels) {
+ // Create the result-set map and add it to the wrapper.
+ ElementPtr result_set = Element::createMap();
+ result_wrapper->set("result-set", result_set);
+
+ // Create the timestamp based on time now and add it to the result set.
+ boost::posix_time::ptime now(boost::posix_time::microsec_clock::universal_time());
+
+ ElementPtr timestamp = Element::create(isc::util::ptimeToText(now));
+ result_set->set("timestamp", timestamp);
+
+ // Create the list of column names and add it to the result set.
+ ElementPtr columns = Element::createList();
+ for (auto label = column_labels.begin(); label != column_labels.end(); ++label) {
+ columns->add(Element::create(*label));
+ }
+ result_set->set("columns", columns);
+
+ // Create the empty value_rows list, add it and then return it.
+ ElementPtr value_rows = Element::createList();
+ result_set->set("rows", value_rows);
+ return (value_rows);
+}
+
+
+void
+LeaseStatCmdsImpl::addValueRow4(ElementPtr value_rows, const SubnetID &subnet_id,
+ int64_t assigned, int64_t declined) {
+ ElementPtr row = Element::createList();
+ row->add(Element::create(static_cast<int64_t>(subnet_id)));
+ row->add(Element::create(getSubnetStat(subnet_id, "total-addresses")));
+ row->add(Element::create(getSubnetStat(subnet_id, "cumulative-assigned-addresses")));
+ row->add(Element::create(assigned));
+ row->add(Element::create(declined));
+ value_rows->add(row);
+}
+
+void
+LeaseStatCmdsImpl::addValueRow6(ElementPtr value_rows, const SubnetID &subnet_id,
+ int64_t assigned, int64_t declined, int64_t assigned_pds) {
+ ElementPtr row = Element::createList();
+ row->add(Element::create(static_cast<int64_t>(subnet_id)));
+ row->add(Element::create(getBigSubnetStat(subnet_id, "total-nas")));
+ row->add(Element::create(getSubnetStat(subnet_id, "cumulative-assigned-nas")));
+ row->add(Element::create(assigned));
+ row->add(Element::create(declined));
+ row->add(Element::create(getBigSubnetStat(subnet_id, "total-pds")));
+ row->add(Element::create(getSubnetStat(subnet_id, "cumulative-assigned-pds")));
+ row->add(Element::create(assigned_pds));
+ value_rows->add(row);
+}
+
+int64_t
+LeaseStatCmdsImpl::getSubnetStat(const SubnetID& subnet_id, const std::string& name) {
+ ObservationPtr stat = StatsMgr::instance().
+ getObservation(StatsMgr::generateName("subnet", subnet_id, name));
+ if (stat) {
+ return (stat->getInteger().first);
+ }
+
+ return (0);
+}
+
+int128_t
+LeaseStatCmdsImpl::getBigSubnetStat(const SubnetID& subnet_id, const std::string& name) {
+ ObservationPtr stat = StatsMgr::instance().
+ getObservation(StatsMgr::generateName("subnet", subnet_id, name));
+ if (stat) {
+ return (stat->getBigInteger().first);
+ }
+
+ return (0);
+}
+
+// Using a critical section to avoid any changes in parallel.
+
+int
+StatCmds::statLease4GetHandler(CalloutHandle& handle) {
+ try {
+ LeaseStatCmdsImpl impl;
+ return (impl.statLease4GetHandler(handle));
+ } catch (const std::exception& ex) {
+
+ LOG_ERROR(stat_cmds_logger, STAT_CMDS_LEASE4_FAILED)
+ .arg(ex.what());
+ }
+ return (1);
+}
+
+int
+StatCmds::statLease6GetHandler(CalloutHandle& handle) {
+ try {
+ LeaseStatCmdsImpl impl;
+ return (impl.statLease6GetHandler(handle));
+ } catch (const std::exception& ex) {
+
+ LOG_ERROR(stat_cmds_logger, STAT_CMDS_LEASE6_FAILED)
+ .arg(ex.what());
+ }
+ return (1);
+}
+
+};
+};
diff --git a/src/hooks/dhcp/stat_cmds/stat_cmds.dox b/src/hooks/dhcp/stat_cmds/stat_cmds.dox
new file mode 100644
index 0000000..0dc0838
--- /dev/null
+++ b/src/hooks/dhcp/stat_cmds/stat_cmds.dox
@@ -0,0 +1,207 @@
+// Copyright (C) 2018-2023 Internet Systems Consortium, Inc. ("ISC")
+//
+// This Source Code Form is subject to the terms of the Mozilla Public
+// License, v. 2.0. If a copy of the MPL was not distributed with this
+// file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+/**
+
+@page libdhcp_stat_cmds Kea Stat Commands Hooks Library
+
+@section libdhcp_stat_cmdsIntro Introduction
+
+Welcome to Kea Stat Commands Hooks Library. This documentation is addressed to
+developers who are interested in the internal operation of the Stat Commands
+library. This file provides information needed to understand and perhaps extend
+this library.
+
+This documentation is stand-alone: you should have read and understood the <a
+href="https://reports.kea.isc.org/dev_guide/">Kea Developer's Guide</a> and in
+particular its section about hooks.
+
+@section stat_cmds Stat Commands Overview
+
+Stat Commands (or stat_cmds) is a Hook library that can be loaded by
+either kea-dhcp4 and kea-dhcp6 servers to extend them with additional
+statistics mechanisms.
+
+The initial purpose of this library is provide supplemental commands for
+obtaining accurate lease statistics in deployments that share lease storage
+between multiple Kea DHCP servers. It is likely that additional statistics
+related commands will be added to this library in future releases as use
+cases for them arise.
+
+The library is structured around command handlers. When the library is
+loaded it registers handlers for new commands. When a command
+is issued (be it directly via control channel or indirectly via REST
+interface from control agent), the code receives a JSON command with
+parameters. The command is routed the appropriate handler, its parameters
+are parsed and command executed accordingly. Lastly, a response is
+constructed and shipped back to the client.
+
+This lease statistics commands interact with both the isc::dhcp::StatsMgr
+and the isc::dhcp::LeaseMgr instance. At the time of writing this text
+(May, 2018), Kea supports four types of lease managers: memfile, MySQL or
+PostgreSQL. The lease statistics commands provided by this library provide a
+unified interface supported by all four of these backends.
+
+As with other hooks, this one keeps its code in a separate namespace which
+corresponds to the file name of the library: isc::stat_cmds.
+
+For background on the design and design choices please refer to: <a
+href="https://gitlab.isc.org/isc-projects/kea/wikis/designs/shared-lease-storage-statistics">Shared Lease Stats Design</a>
+
+@section stat_cmdsCode Stat Commands Code Overview
+
+Library operation starts with Kea calling the load() function (file
+stat_cmds_callouts.cc). This function registers the command callout
+functions for each of the libraries commands. For a list,
+see @ref isc::stat_cmds::StatCmds class documentation. This class uses
+the Pimpl design pattern, and thus the actual implementation is hidden
+in @ref isc::stat_cmds::LeaseStatCmdsImpl.
+
+Unlike similar libraries, the Pimpl class is differentiated from the
+the StatCmds class by the prefix "Lease" and it is instantiated in the outer
+handler (e.g. @ref isc::stat_cmds::StatCmds::statLease4GetHandler) rather than
+the StatCmds constructor. This was done in the event that commands, unrelated
+to lease statistics, are added to this library and that would be better served
+by Pimpl derivations specific to them.
+
+@subsection stat_cmdsLeaseStatCode Lease Stat Commands Code Overview
+
+There are two shared lease statistic commands, "stat-lease4-get" and "stat-lease6-get".
+Both of these support the same input parameters and have their own command handlers:
+
+- @ref isc::stat_cmds::LeaseStatCmdsImpl::statLease4GetHandler (stat-lease4-get)
+- @ref isc::stat_cmds::LeaseStatCmdsImpl::statLease6GetHandler (stat-lease6-get)
+
+Briefly, the commands are intended to fetch the lease statistics per subnet
+for the range of subnets described by the input parameters. JSON text structure
+of the commands is as follows:
+
+DHCPv4 command:
+
+@code
+{
+ "command": "stat-lease4-get",
+ "arguments": {
+ "subnet-id": x
+ "subnet-range": {
+ "first-subnet-id": x,
+ "last-subnet-id": y
+ }
+ }
+}
+
+ where subnet-id and subnet-range are optional and mutually exclusive
+@endcode
+
+DHCPv6 command:
+
+@code
+{
+ "command": "stat-lease6-get",
+ "arguments": {
+ "subnet-id": x
+ "subnet-range": {
+ "first-subnet-id": x,
+ "last-subnet-id": y
+ }
+ }
+}
+
+ where subnet-id and subnet-range are optional and mutually exclusive
+@endcode
+
+
+
+Command handling
+for both commands is symmetrical consists of the following steps:
+
+-# The input parameters (if any) are parsed. Invalid values or
+combinations if detected result in generating a CONTROL_RESULT_ERROR
+response to the client. (See @ref isc::stat_cmds::LeaseStatCmdsImpl::getParameters
+and @ref isc::stat_cmds::LeaseStatCmdsImpl::Parameters)
+
+-# The parameters are used to identify the range of configured subnets
+to include in the response. This is done by querying subnet configuration
+housed by @ref isc::dhcp::CfgMgr. If the range contains no known subnets then a
+CONTROL_RESULT_EMPTY response is sent back to the client.
+
+-# The initial result-set response is constructed. Essentially this is
+an @ref isc::data::Element tree, which converted to JSON would appear as follows:
+
+@code
+ "result-set": {
+ "timestamp": "2018-03-22 09:43:30.815371",
+ "columns": ["<label-1>, <label-2>, ... ],
+ "rows": []
+ }
+@endcode
+
+-# The actual lease statistics are then retrieved from @ref isc::dhcp::LeaseMgr instance
+by invoking of the three functions based on the input parameters:
+
+DHCPv4 functions:
+
+- @ref isc::dhcp::LeaseMgr::startLeaseStatsQuery4
+- @ref isc::dhcp::LeaseMgr::startSubnetLeaseStatsQuery4
+- @ref isc::dhcp::LeaseMgr::startSubnetRangeLeaseStatsQuery4
+
+DHCPv6 functions:
+
+- @ref isc::dhcp::LeaseMgr::startLeaseStatsQuery6
+- @ref isc::dhcp::LeaseMgr::startSubnetLeaseStatsQuery6
+- @ref isc::dhcp::LeaseMgr::startSubnetRangeLeaseStatsQuery6
+
+-# Iterate over the range of qualifying subnets adding a row of statistics for
+each subnet to the result-set. Each row combines the subnet total(s) from isc::dhcp::StatsMgr
+with the type and state counts from the lease query results. For subnets with no query
+data (i.e. no leases), their rows have non-zero values for totals only.
+
+-# Finally, a CONTROL_RESULT_SUCCESS response is generated containing the populated result-set.
+
+A DHCPv4 response might look like this:
+
+@code
+ {
+ "result-set\": {
+ "columns\": [
+ "subnet-id", "total-addresses",
+ "cumulative-assigned-addresses",
+ "assigned-addresses", "declined-addresses"
+ ],
+ "rows\": [
+ [ 30, 256, 300, 100, 2 ],
+ [ 40, 16, 5, 0, 0 ],
+ [ 50, 256, 100, 35, 0 ]
+ ],
+ timestamp\": \"2018-05-04 15:03:37.000000\" }
+ }
+@endcode
+
+and DHCPv6 response might look like this:
+
+@code
+ {
+ "result-set": {
+ "columns": [
+ "subnet-id", "total-nas", "cumulative-assigned-nas",
+ "assigned-nas", "declined-addresses", "total-pds",
+ "cumulative-assigned-pds", "assigned-pds"
+ ],
+ "rows": [
+ [ 30, 16, 20, 6, 0, 65536, 1000, 400 ],
+ [ 40, 16777216, 1100000, 989837, 0, 0, 0, 0 ]
+ ],
+ "timestamp": "2018-05-04 15:03:37.000000" }
+ }
+@endcode
+
+@section stat_cmdsMTCompatibility Multi-Threading Compatibility
+
+The Stat Commands Hook library is compatible with multi-threading.
+All commands are executed inside a critical section, i.e. with threads stopped.
+It makes sense to not have lease state changes when retrieving lease counts.
+
+*/
diff --git a/src/hooks/dhcp/stat_cmds/stat_cmds.h b/src/hooks/dhcp/stat_cmds/stat_cmds.h
new file mode 100644
index 0000000..2205255
--- /dev/null
+++ b/src/hooks/dhcp/stat_cmds/stat_cmds.h
@@ -0,0 +1,124 @@
+// Copyright (C) 2018-2023 Internet Systems Consortium, Inc. ("ISC")
+//
+// This Source Code Form is subject to the terms of the Mozilla Public
+// License, v. 2.0. If a copy of the MPL was not distributed with this
+// file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+#ifndef STAT_CMDS_H
+#define STAT_CMDS_H
+
+#include <hooks/hooks.h>
+
+#include <boost/shared_ptr.hpp>
+
+namespace isc {
+namespace stat_cmds {
+
+/// @brief Forward declaration of implementation class.
+class StatCmdsImpl;
+
+/// @brief Implements the logic for processing commands pertaining to
+/// stat manipulation.
+///
+/// This class is used by the callouts implementing command handlers for
+/// stat manipulations.
+class StatCmds {
+public:
+ /// @brief Default Constructor.
+ StatCmds() {};
+
+ /// @brief stat-lease4-get command handler
+ ///
+ /// This command attempts to fetch lease4 statistics for one or
+ /// more subnets based upon subnet selection criteria (or lack thereof).
+ /// It extracts the command name and arguments from the given CalloutHandle,
+ /// attempts to process them, and then set's the handle's "response"
+ /// arguments accordingly.
+ /// {
+ /// "command": "stat-lease4-get",
+ /// "arguments": {
+ /// "subnet-id": 10 // optional
+ /// "subnet-range": { // optional
+ /// "first-subnet-id": 10, // id >= 10
+ /// "last-subnet-id": 50 // id <= 50
+ /// }
+ /// }
+ /// }
+ ///
+ /// It produces a response as described below:
+ ///
+ /// {
+ /// "result": 0,
+ /// "text": "<message>",
+ /// "arguments": {
+ /// "result-set": {
+ /// "timestamp": "2018-03-22 09:43:30.815371",
+ /// "columns": ["subnet_id", "total-addresses",
+ /// "cumulative-assigned-addresses",
+ /// "assigned-addresses", "declined-addresses"],
+ /// "rows": [
+ /// [1, 600, 1000, 450, 3],
+ /// :
+ /// ]
+ /// }
+ /// }
+ /// }
+ ///
+ /// @param handle Callout context - which is expected to contain the
+ ///
+ /// add command JSON text in the "command" argument
+ /// @return result of the operation
+ int
+ statLease4GetHandler(hooks::CalloutHandle& handle);
+
+ /// @brief stat-lease6-get command handler
+ ///
+ /// This command attempts to fetch lease6 statistics for one or
+ /// more subnets based upon subnet selection criteria (or lack thereof).
+ /// It extracts the command name and arguments from the given CalloutHandle,
+ /// attempts to process them, and then set's the handle's "response"
+ /// argument accordingly.
+ /// {
+ /// "command": "stat-lease6-get",
+ /// "arguments": {
+ /// "subnet-id": 10 // optional
+ /// "subnet-range": { // optional
+ /// "first-subnet-id": 10, // id >= 10
+ /// "last-subnet-id": 50 // id <= 50
+ /// }
+ /// }
+ /// }
+ ///
+ /// It produces a response as described below:
+ ///
+ /// {
+ /// "result": 0,
+ /// "text": "<message>",
+ /// "arguments": {
+ /// "result-set": {
+ /// "timestamp": "2018-03-22 09:43:30.815371",
+ /// "columns": ["subnet_id", "total-nas",
+ /// "cumulative-assigned-nas",
+ /// "assigned-nas", "declined-addresses",
+ /// "total-pds", "cumulative-assigned-pds",
+ /// "assigned-pds"],
+ /// "rows": [
+ /// [1, 600, 1000, 450, 3, 64, 20, 10],
+ /// :
+ /// ]
+ /// }
+ /// }
+ /// }
+ ///
+ ///
+ /// @param handle Callout context - which is expected to contain the
+ /// add command JSON text in the "command" argument
+ /// @return result of the operation
+ int
+ statLease6GetHandler(hooks::CalloutHandle& handle);
+};
+
+};
+};
+
+#endif
diff --git a/src/hooks/dhcp/stat_cmds/stat_cmds_callouts.cc b/src/hooks/dhcp/stat_cmds/stat_cmds_callouts.cc
new file mode 100644
index 0000000..228772f
--- /dev/null
+++ b/src/hooks/dhcp/stat_cmds/stat_cmds_callouts.cc
@@ -0,0 +1,90 @@
+// Copyright (C) 2018-2022 Internet Systems Consortium, Inc. ("ISC")
+//
+// This Source Code Form is subject to the terms of the Mozilla Public
+// License, v. 2.0. If a copy of the MPL was not distributed with this
+// file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+// Functions accessed by the hooks framework use C linkage to avoid the name
+// mangling that accompanies use of the C++ compiler as well as to avoid
+// issues related to namespaces.
+
+#include <config.h>
+
+#include <stat_cmds.h>
+#include <stat_cmds_log.h>
+#include <cc/command_interpreter.h>
+#include <dhcpsrv/cfgmgr.h>
+#include <hooks/hooks.h>
+#include <process/daemon.h>
+
+using namespace isc::dhcp;
+using namespace isc::hooks;
+using namespace isc::process;
+using namespace isc::stat_cmds;
+
+extern "C" {
+
+/// @brief This is a command callout for 'stat-lease4-get' command.
+///
+/// @param handle Callout handle used to retrieve a command and
+/// provide a response.
+/// @return 0 if this callout has been invoked successfully,
+/// 1 otherwise.
+int stat_lease4_get(CalloutHandle& handle) {
+ StatCmds stat_cmds;
+ return(stat_cmds.statLease4GetHandler(handle));
+}
+
+/// @brief This is a command callout for 'stat-lease6-get' command.
+///
+/// @param handle Callout handle used to retrieve a command and
+/// provide a response.
+/// @return 0 if this callout has been invoked successfully,
+/// 1 otherwise.
+int stat_lease6_get(CalloutHandle& handle) {
+ StatCmds stat_cmds;
+ return(stat_cmds.statLease6GetHandler(handle));
+}
+
+/// @brief This function is called when the library is loaded.
+///
+/// @param handle library handle
+/// @return 0 when initialization is successful, 1 otherwise
+int load(LibraryHandle& handle) {
+ // Make the hook library not loadable by d2 or ca.
+ uint16_t family = CfgMgr::instance().getFamily();
+ const std::string& proc_name = Daemon::getProcName();
+ if (family == AF_INET) {
+ if (proc_name != "kea-dhcp4") {
+ isc_throw(isc::Unexpected, "Bad process name: " << proc_name
+ << ", expected kea-dhcp4");
+ }
+ } else {
+ if (proc_name != "kea-dhcp6") {
+ isc_throw(isc::Unexpected, "Bad process name: " << proc_name
+ << ", expected kea-dhcp6");
+ }
+ }
+
+ handle.registerCommandCallout("stat-lease4-get", stat_lease4_get);
+ handle.registerCommandCallout("stat-lease6-get", stat_lease6_get);
+ LOG_INFO(stat_cmds_logger, STAT_CMDS_INIT_OK);
+ return (0);
+}
+
+/// @brief This function is called when the library is unloaded.
+///
+/// @return 0 if deregistration was successful, 1 otherwise
+int unload() {
+ LOG_INFO(stat_cmds_logger, STAT_CMDS_DEINIT_OK);
+ return (0);
+}
+
+/// @brief This function is called to retrieve the multi-threading compatibility.
+///
+/// @return 1 which means compatible with multi-threading.
+int multi_threading_compatible() {
+ return (1);
+}
+
+} // end extern "C"
diff --git a/src/hooks/dhcp/stat_cmds/stat_cmds_log.cc b/src/hooks/dhcp/stat_cmds/stat_cmds_log.cc
new file mode 100644
index 0000000..1b985a6
--- /dev/null
+++ b/src/hooks/dhcp/stat_cmds/stat_cmds_log.cc
@@ -0,0 +1,18 @@
+// Copyright (C) 2018 Internet Systems Consortium, Inc. ("ISC")
+//
+// This Source Code Form is subject to the terms of the Mozilla Public
+// License, v. 2.0. If a copy of the MPL was not distributed with this
+// file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+#include <config.h>
+
+#include <stat_cmds_log.h>
+
+namespace isc {
+namespace stat_cmds {
+
+isc::log::Logger stat_cmds_logger("stat-cmds-hooks");
+
+}
+}
+
diff --git a/src/hooks/dhcp/stat_cmds/stat_cmds_log.h b/src/hooks/dhcp/stat_cmds/stat_cmds_log.h
new file mode 100644
index 0000000..1370608
--- /dev/null
+++ b/src/hooks/dhcp/stat_cmds/stat_cmds_log.h
@@ -0,0 +1,23 @@
+// Copyright (C) 2018 Internet Systems Consortium, Inc. ("ISC")
+//
+// This Source Code Form is subject to the terms of the Mozilla Public
+// License, v. 2.0. If a copy of the MPL was not distributed with this
+// file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+#ifndef STAT_CMD_LOG_H
+#define STAT_CMD_LOG_H
+
+#include <log/logger_support.h>
+#include <log/macros.h>
+#include <stat_cmds_messages.h>
+
+namespace isc {
+namespace stat_cmds {
+
+extern isc::log::Logger stat_cmds_logger;
+
+} // end of isc::stat_cmds
+} // end of isc namespace
+
+
+#endif
diff --git a/src/hooks/dhcp/stat_cmds/stat_cmds_messages.cc b/src/hooks/dhcp/stat_cmds/stat_cmds_messages.cc
new file mode 100644
index 0000000..b43cbbb
--- /dev/null
+++ b/src/hooks/dhcp/stat_cmds/stat_cmds_messages.cc
@@ -0,0 +1,49 @@
+// File created from ../../../../src/hooks/dhcp/stat_cmds/stat_cmds_messages.mes
+
+#include <cstddef>
+#include <log/message_types.h>
+#include <log/message_initializer.h>
+
+extern const isc::log::MessageID STAT_CMDS_DEINIT_FAILED = "STAT_CMDS_DEINIT_FAILED";
+extern const isc::log::MessageID STAT_CMDS_DEINIT_OK = "STAT_CMDS_DEINIT_OK";
+extern const isc::log::MessageID STAT_CMDS_INIT_FAILED = "STAT_CMDS_INIT_FAILED";
+extern const isc::log::MessageID STAT_CMDS_INIT_OK = "STAT_CMDS_INIT_OK";
+extern const isc::log::MessageID STAT_CMDS_LEASE4_FAILED = "STAT_CMDS_LEASE4_FAILED";
+extern const isc::log::MessageID STAT_CMDS_LEASE4_GET = "STAT_CMDS_LEASE4_GET";
+extern const isc::log::MessageID STAT_CMDS_LEASE4_GET_FAILED = "STAT_CMDS_LEASE4_GET_FAILED";
+extern const isc::log::MessageID STAT_CMDS_LEASE4_GET_INVALID = "STAT_CMDS_LEASE4_GET_INVALID";
+extern const isc::log::MessageID STAT_CMDS_LEASE4_GET_NO_SUBNETS = "STAT_CMDS_LEASE4_GET_NO_SUBNETS";
+extern const isc::log::MessageID STAT_CMDS_LEASE4_ORPHANED_STATS = "STAT_CMDS_LEASE4_ORPHANED_STATS";
+extern const isc::log::MessageID STAT_CMDS_LEASE6_FAILED = "STAT_CMDS_LEASE6_FAILED";
+extern const isc::log::MessageID STAT_CMDS_LEASE6_GET = "STAT_CMDS_LEASE6_GET";
+extern const isc::log::MessageID STAT_CMDS_LEASE6_GET_FAILED = "STAT_CMDS_LEASE6_GET_FAILED";
+extern const isc::log::MessageID STAT_CMDS_LEASE6_GET_INVALID = "STAT_CMDS_LEASE6_GET_INVALID";
+extern const isc::log::MessageID STAT_CMDS_LEASE6_GET_NO_SUBNETS = "STAT_CMDS_LEASE6_GET_NO_SUBNETS";
+extern const isc::log::MessageID STAT_CMDS_LEASE6_ORPHANED_STATS = "STAT_CMDS_LEASE6_ORPHANED_STATS";
+
+namespace {
+
+const char* values[] = {
+ "STAT_CMDS_DEINIT_FAILED", "unloading Stat Commands hooks library failed: %1",
+ "STAT_CMDS_DEINIT_OK", "unloading Stat Commands hooks library successful",
+ "STAT_CMDS_INIT_FAILED", "loading Stat Commands hooks library failed: %1",
+ "STAT_CMDS_INIT_OK", "loading Stat Commands hooks library successful",
+ "STAT_CMDS_LEASE4_FAILED", "stat-lease4-get command failed: reason: %1",
+ "STAT_CMDS_LEASE4_GET", "stat-lease4-get command successful, parameters: %1 rows found: %2",
+ "STAT_CMDS_LEASE4_GET_FAILED", "stat-lease4-get command failed: parameters: %1, reason: %2",
+ "STAT_CMDS_LEASE4_GET_INVALID", "stat-lease4-get command is malformed or invalid, reason: %1",
+ "STAT_CMDS_LEASE4_GET_NO_SUBNETS", "stat-lease4-get, parameters: %1, %2\"",
+ "STAT_CMDS_LEASE4_ORPHANED_STATS", "stat-lease4-get command omitted statistics for one or more non-existent subnets",
+ "STAT_CMDS_LEASE6_FAILED", "stat-lease6-get command failed: reason: %1",
+ "STAT_CMDS_LEASE6_GET", "stat-lease6-get command successful, parameters: %1 rows found: %2",
+ "STAT_CMDS_LEASE6_GET_FAILED", "stat-lease6-get command failed: parameters: %1, reason: %2",
+ "STAT_CMDS_LEASE6_GET_INVALID", "stat-lease6-get command is malformed or invalid, reason: %1",
+ "STAT_CMDS_LEASE6_GET_NO_SUBNETS", "stat-lease6-get, parameters: %1, %2\"",
+ "STAT_CMDS_LEASE6_ORPHANED_STATS", "stat-lease6-get command omitted statistics for one or more non-existent subnets",
+ NULL
+};
+
+const isc::log::MessageInitializer initializer(values);
+
+} // Anonymous namespace
+
diff --git a/src/hooks/dhcp/stat_cmds/stat_cmds_messages.h b/src/hooks/dhcp/stat_cmds/stat_cmds_messages.h
new file mode 100644
index 0000000..988ad43
--- /dev/null
+++ b/src/hooks/dhcp/stat_cmds/stat_cmds_messages.h
@@ -0,0 +1,25 @@
+// File created from ../../../../src/hooks/dhcp/stat_cmds/stat_cmds_messages.mes
+
+#ifndef STAT_CMDS_MESSAGES_H
+#define STAT_CMDS_MESSAGES_H
+
+#include <log/message_types.h>
+
+extern const isc::log::MessageID STAT_CMDS_DEINIT_FAILED;
+extern const isc::log::MessageID STAT_CMDS_DEINIT_OK;
+extern const isc::log::MessageID STAT_CMDS_INIT_FAILED;
+extern const isc::log::MessageID STAT_CMDS_INIT_OK;
+extern const isc::log::MessageID STAT_CMDS_LEASE4_FAILED;
+extern const isc::log::MessageID STAT_CMDS_LEASE4_GET;
+extern const isc::log::MessageID STAT_CMDS_LEASE4_GET_FAILED;
+extern const isc::log::MessageID STAT_CMDS_LEASE4_GET_INVALID;
+extern const isc::log::MessageID STAT_CMDS_LEASE4_GET_NO_SUBNETS;
+extern const isc::log::MessageID STAT_CMDS_LEASE4_ORPHANED_STATS;
+extern const isc::log::MessageID STAT_CMDS_LEASE6_FAILED;
+extern const isc::log::MessageID STAT_CMDS_LEASE6_GET;
+extern const isc::log::MessageID STAT_CMDS_LEASE6_GET_FAILED;
+extern const isc::log::MessageID STAT_CMDS_LEASE6_GET_INVALID;
+extern const isc::log::MessageID STAT_CMDS_LEASE6_GET_NO_SUBNETS;
+extern const isc::log::MessageID STAT_CMDS_LEASE6_ORPHANED_STATS;
+
+#endif // STAT_CMDS_MESSAGES_H
diff --git a/src/hooks/dhcp/stat_cmds/stat_cmds_messages.mes b/src/hooks/dhcp/stat_cmds/stat_cmds_messages.mes
new file mode 100644
index 0000000..935ecc4
--- /dev/null
+++ b/src/hooks/dhcp/stat_cmds/stat_cmds_messages.mes
@@ -0,0 +1,81 @@
+# Copyright (C) 2018-2021 Internet Systems Consortium, Inc. ("ISC")
+
+% STAT_CMDS_DEINIT_FAILED unloading Stat Commands hooks library failed: %1
+This error message indicates an error during unloading the Lease Commands
+hooks library. The details of the error are provided as argument of
+the log message.
+
+% STAT_CMDS_DEINIT_OK unloading Stat Commands hooks library successful
+This info message indicates that the Stat Commands hooks library has been
+removed successfully.
+
+% STAT_CMDS_INIT_FAILED loading Stat Commands hooks library failed: %1
+This error message indicates an error during loading the Lease Commands
+hooks library. The details of the error are provided as argument of
+the log message.
+
+% STAT_CMDS_INIT_OK loading Stat Commands hooks library successful
+This info message indicates that the Stat Commands hooks library has been
+loaded successfully. Enjoy!
+
+% STAT_CMDS_LEASE4_FAILED stat-lease4-get command failed: reason: %1
+The stat-lease4-get command has failed. The reason for failure is logged.
+
+% STAT_CMDS_LEASE4_GET stat-lease4-get command successful, parameters: %1 rows found: %2
+The stat-lease4-get command has been successful. The log will contain
+the parameters supplied and the number of rows found.
+
+% STAT_CMDS_LEASE4_GET_FAILED stat-lease4-get command failed: parameters: %1, reason: %2
+The stat-lease4-get command has failed. Both the parameters supplied and
+the reason for failure are logged.
+
+% STAT_CMDS_LEASE4_GET_INVALID stat-lease4-get command is malformed or invalid, reason: %1
+The stat-lease4-get command was either malformed or contained invalid
+parameters. A detailed explanation should be logged.
+
+% STAT_CMDS_LEASE4_GET_NO_SUBNETS stat-lease4-get, parameters: %1, %2"
+The parameters submitted with stat-lease4-get were valid but excluded all
+known subnets. The parameters supplied along with an explanation should
+be logged.
+
+% STAT_CMDS_LEASE4_ORPHANED_STATS stat-lease4-get command omitted statistics for one or more non-existent subnets
+During processing the stat-lease4-get found statistics for subnet IDs for
+non-existent subnets. These values were omitted from the command response
+returned to the user. This may occur when subnets have been removed from
+the configuration in a manner that did not also remove the statistics. While
+the existence of such statistics is not harmful, steps should be considered
+to remove them. For memfile lease storage, the problem should disappear
+upon configuration reload or server restart. For database lease storage the
+issue is more complicated and as of Kea 2.0.0 we do not yet have a clean
+solution.
+
+% STAT_CMDS_LEASE6_FAILED stat-lease6-get command failed: reason: %1
+The stat-lease6-get command has failed. The reason for failure is logged.
+
+% STAT_CMDS_LEASE6_GET stat-lease6-get command successful, parameters: %1 rows found: %2
+The stat-lease6-get command has been successful. The log will contain
+the parameters supplied and the number of rows found.
+
+% STAT_CMDS_LEASE6_GET_FAILED stat-lease6-get command failed: parameters: %1, reason: %2
+The stat-lease6-get command has failed. Both the parameters supplied and
+the reason for failure are logged.
+
+% STAT_CMDS_LEASE6_GET_INVALID stat-lease6-get command is malformed or invalid, reason: %1
+The stat-lease6-get command was either malformed or contained invalid
+parameters. A detailed explanation should be logged.
+
+% STAT_CMDS_LEASE6_GET_NO_SUBNETS stat-lease6-get, parameters: %1, %2"
+The parameters submitted with stat-lease6-get were valid but excluded all
+known subnets. The parameters supplied along with an explanation should
+be logged.
+
+% STAT_CMDS_LEASE6_ORPHANED_STATS stat-lease6-get command omitted statistics for one or more non-existent subnets
+During processing the stat-lease4-get found statistics for subnet IDs for
+non-existent subnets. These values were omitted from the command response
+returned to the user. This may occur when subnets have been removed from
+the configuration in a manner that did not also remove the statistics. While
+the existence of such statistics is not harmful, steps should be considered
+to remove them. For memfile lease storage, the problem should disappear
+upon configuration reload or server restart. For database lease storage the
+issue is more complicated and as of Kea 2.0.0 we do not yet have a clean
+solution.
diff --git a/src/hooks/dhcp/stat_cmds/tests/Makefile.am b/src/hooks/dhcp/stat_cmds/tests/Makefile.am
new file mode 100644
index 0000000..c4747ab
--- /dev/null
+++ b/src/hooks/dhcp/stat_cmds/tests/Makefile.am
@@ -0,0 +1,75 @@
+SUBDIRS = .
+
+AM_CPPFLAGS = -I$(top_builddir)/src/lib -I$(top_srcdir)/src/lib
+AM_CPPFLAGS += -I$(top_builddir)/src/hooks/dhcp/stat_cmds -I$(top_srcdir)/src/hooks/dhcp/stat_cmds
+AM_CPPFLAGS += $(BOOST_INCLUDES)
+AM_CPPFLAGS += -DSTAT_CMDS_LIB_SO=\"$(abs_top_builddir)/src/hooks/dhcp/stat_cmds/.libs/libdhcp_stat_cmds.so\"
+AM_CPPFLAGS += -DINSTALL_PROG=\"$(abs_top_srcdir)/install-sh\"
+
+if HAVE_MYSQL
+AM_CPPFLAGS += $(MYSQL_CPPFLAGS)
+endif
+if HAVE_PGSQL
+AM_CPPFLAGS += $(PGSQL_CPPFLAGS)
+endif
+
+AM_CXXFLAGS = $(KEA_CXXFLAGS)
+
+if USE_STATIC_LINK
+AM_LDFLAGS = -static
+endif
+
+# Unit test data files need to get installed.
+EXTRA_DIST =
+
+CLEANFILES = *.gcno *.gcda
+
+TESTS_ENVIRONMENT = $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND)
+
+LOG_COMPILER = $(LIBTOOL)
+AM_LOG_FLAGS = --mode=execute
+
+TESTS =
+if HAVE_GTEST
+TESTS += stat_cmds_unittests
+
+stat_cmds_unittests_SOURCES = run_unittests.cc
+stat_cmds_unittests_SOURCES += stat_cmds_unittest.cc
+
+stat_cmds_unittests_CPPFLAGS = $(AM_CPPFLAGS) $(GTEST_INCLUDES) $(LOG4CPLUS_INCLUDES)
+
+stat_cmds_unittests_LDFLAGS = $(AM_LDFLAGS) $(CRYPTO_LDFLAGS) $(GTEST_LDFLAGS)
+
+stat_cmds_unittests_CXXFLAGS = $(AM_CXXFLAGS)
+
+stat_cmds_unittests_LDADD = $(top_builddir)/src/lib/dhcpsrv/libkea-dhcpsrv.la
+stat_cmds_unittests_LDADD += $(top_builddir)/src/lib/process/libkea-process.la
+stat_cmds_unittests_LDADD += $(top_builddir)/src/lib/eval/libkea-eval.la
+stat_cmds_unittests_LDADD += $(top_builddir)/src/lib/dhcp_ddns/libkea-dhcp_ddns.la
+stat_cmds_unittests_LDADD += $(top_builddir)/src/lib/stats/libkea-stats.la
+stat_cmds_unittests_LDADD += $(top_builddir)/src/lib/config/libkea-cfgclient.la
+stat_cmds_unittests_LDADD += $(top_builddir)/src/lib/http/libkea-http.la
+stat_cmds_unittests_LDADD += $(top_builddir)/src/lib/dhcp/libkea-dhcp++.la
+stat_cmds_unittests_LDADD += $(top_builddir)/src/lib/hooks/libkea-hooks.la
+stat_cmds_unittests_LDADD += $(top_builddir)/src/lib/database/libkea-database.la
+stat_cmds_unittests_LDADD += $(top_builddir)/src/lib/cc/libkea-cc.la
+stat_cmds_unittests_LDADD += $(top_builddir)/src/lib/asiolink/libkea-asiolink.la
+stat_cmds_unittests_LDADD += $(top_builddir)/src/lib/dns/libkea-dns++.la
+stat_cmds_unittests_LDADD += $(top_builddir)/src/lib/cryptolink/libkea-cryptolink.la
+stat_cmds_unittests_LDADD += $(top_builddir)/src/lib/log/libkea-log.la
+stat_cmds_unittests_LDADD += $(top_builddir)/src/lib/util/libkea-util.la
+stat_cmds_unittests_LDADD += $(top_builddir)/src/lib/exceptions/libkea-exceptions.la
+stat_cmds_unittests_LDADD += $(LOG4CPLUS_LIBS)
+stat_cmds_unittests_LDADD += $(CRYPTO_LIBS)
+stat_cmds_unittests_LDADD += $(BOOST_LIBS)
+stat_cmds_unittests_LDADD += $(GTEST_LDADD)
+
+if HAVE_MYSQL
+stat_cmds_unittests_LDFLAGS += $(MYSQL_LIBS)
+endif
+if HAVE_PGSQL
+stat_cmds_unittests_LDFLAGS += $(PGSQL_LIBS)
+endif
+
+endif
+noinst_PROGRAMS = $(TESTS)
diff --git a/src/hooks/dhcp/stat_cmds/tests/Makefile.in b/src/hooks/dhcp/stat_cmds/tests/Makefile.in
new file mode 100644
index 0000000..a4030b1
--- /dev/null
+++ b/src/hooks/dhcp/stat_cmds/tests/Makefile.in
@@ -0,0 +1,1043 @@
+# Makefile.in generated by automake 1.16.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2018 Free Software Foundation, Inc.
+
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+VPATH = @srcdir@
+am__is_gnu_make = { \
+ if test -z '$(MAKELEVEL)'; then \
+ false; \
+ elif test -n '$(MAKE_HOST)'; then \
+ true; \
+ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+ true; \
+ else \
+ false; \
+ fi; \
+}
+am__make_running_with_option = \
+ case $${target_option-} in \
+ ?) ;; \
+ *) echo "am__make_running_with_option: internal error: invalid" \
+ "target option '$${target_option-}' specified" >&2; \
+ exit 1;; \
+ esac; \
+ has_opt=no; \
+ sane_makeflags=$$MAKEFLAGS; \
+ if $(am__is_gnu_make); then \
+ sane_makeflags=$$MFLAGS; \
+ else \
+ case $$MAKEFLAGS in \
+ *\\[\ \ ]*) \
+ bs=\\; \
+ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
+ esac; \
+ fi; \
+ skip_next=no; \
+ strip_trailopt () \
+ { \
+ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+ }; \
+ for flg in $$sane_makeflags; do \
+ test $$skip_next = yes && { skip_next=no; continue; }; \
+ case $$flg in \
+ *=*|--*) continue;; \
+ -*I) strip_trailopt 'I'; skip_next=yes;; \
+ -*I?*) strip_trailopt 'I';; \
+ -*O) strip_trailopt 'O'; skip_next=yes;; \
+ -*O?*) strip_trailopt 'O';; \
+ -*l) strip_trailopt 'l'; skip_next=yes;; \
+ -*l?*) strip_trailopt 'l';; \
+ -[dEDm]) skip_next=yes;; \
+ -[JT]) skip_next=yes;; \
+ esac; \
+ case $$flg in \
+ *$$target_option*) has_opt=yes; break;; \
+ esac; \
+ done; \
+ test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+@HAVE_MYSQL_TRUE@am__append_1 = $(MYSQL_CPPFLAGS)
+@HAVE_PGSQL_TRUE@am__append_2 = $(PGSQL_CPPFLAGS)
+TESTS = $(am__EXEEXT_1)
+@HAVE_GTEST_TRUE@am__append_3 = stat_cmds_unittests
+@HAVE_GTEST_TRUE@@HAVE_MYSQL_TRUE@am__append_4 = $(MYSQL_LIBS)
+@HAVE_GTEST_TRUE@@HAVE_PGSQL_TRUE@am__append_5 = $(PGSQL_LIBS)
+noinst_PROGRAMS = $(am__EXEEXT_2)
+subdir = src/hooks/dhcp/stat_cmds/tests
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4macros/ax_boost_for_kea.m4 \
+ $(top_srcdir)/m4macros/ax_cpp11.m4 \
+ $(top_srcdir)/m4macros/ax_cpp20.m4 \
+ $(top_srcdir)/m4macros/ax_crypto.m4 \
+ $(top_srcdir)/m4macros/ax_find_library.m4 \
+ $(top_srcdir)/m4macros/ax_gssapi.m4 \
+ $(top_srcdir)/m4macros/ax_gtest.m4 \
+ $(top_srcdir)/m4macros/ax_isc_rpath.m4 \
+ $(top_srcdir)/m4macros/ax_netconf.m4 \
+ $(top_srcdir)/m4macros/libtool.m4 \
+ $(top_srcdir)/m4macros/ltoptions.m4 \
+ $(top_srcdir)/m4macros/ltsugar.m4 \
+ $(top_srcdir)/m4macros/ltversion.m4 \
+ $(top_srcdir)/m4macros/lt~obsolete.m4 \
+ $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+@HAVE_GTEST_TRUE@am__EXEEXT_1 = stat_cmds_unittests$(EXEEXT)
+am__EXEEXT_2 = $(am__EXEEXT_1)
+PROGRAMS = $(noinst_PROGRAMS)
+am__stat_cmds_unittests_SOURCES_DIST = run_unittests.cc \
+ stat_cmds_unittest.cc
+@HAVE_GTEST_TRUE@am_stat_cmds_unittests_OBJECTS = \
+@HAVE_GTEST_TRUE@ stat_cmds_unittests-run_unittests.$(OBJEXT) \
+@HAVE_GTEST_TRUE@ stat_cmds_unittests-stat_cmds_unittest.$(OBJEXT)
+stat_cmds_unittests_OBJECTS = $(am_stat_cmds_unittests_OBJECTS)
+am__DEPENDENCIES_1 =
+@HAVE_GTEST_TRUE@stat_cmds_unittests_DEPENDENCIES = $(top_builddir)/src/lib/dhcpsrv/libkea-dhcpsrv.la \
+@HAVE_GTEST_TRUE@ $(top_builddir)/src/lib/process/libkea-process.la \
+@HAVE_GTEST_TRUE@ $(top_builddir)/src/lib/eval/libkea-eval.la \
+@HAVE_GTEST_TRUE@ $(top_builddir)/src/lib/dhcp_ddns/libkea-dhcp_ddns.la \
+@HAVE_GTEST_TRUE@ $(top_builddir)/src/lib/stats/libkea-stats.la \
+@HAVE_GTEST_TRUE@ $(top_builddir)/src/lib/config/libkea-cfgclient.la \
+@HAVE_GTEST_TRUE@ $(top_builddir)/src/lib/http/libkea-http.la \
+@HAVE_GTEST_TRUE@ $(top_builddir)/src/lib/dhcp/libkea-dhcp++.la \
+@HAVE_GTEST_TRUE@ $(top_builddir)/src/lib/hooks/libkea-hooks.la \
+@HAVE_GTEST_TRUE@ $(top_builddir)/src/lib/database/libkea-database.la \
+@HAVE_GTEST_TRUE@ $(top_builddir)/src/lib/cc/libkea-cc.la \
+@HAVE_GTEST_TRUE@ $(top_builddir)/src/lib/asiolink/libkea-asiolink.la \
+@HAVE_GTEST_TRUE@ $(top_builddir)/src/lib/dns/libkea-dns++.la \
+@HAVE_GTEST_TRUE@ $(top_builddir)/src/lib/cryptolink/libkea-cryptolink.la \
+@HAVE_GTEST_TRUE@ $(top_builddir)/src/lib/log/libkea-log.la \
+@HAVE_GTEST_TRUE@ $(top_builddir)/src/lib/util/libkea-util.la \
+@HAVE_GTEST_TRUE@ $(top_builddir)/src/lib/exceptions/libkea-exceptions.la \
+@HAVE_GTEST_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+@HAVE_GTEST_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
+AM_V_lt = $(am__v_lt_@AM_V@)
+am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
+am__v_lt_0 = --silent
+am__v_lt_1 =
+stat_cmds_unittests_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX \
+ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CXXLD) \
+ $(stat_cmds_unittests_CXXFLAGS) $(CXXFLAGS) \
+ $(stat_cmds_unittests_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_P = $(am__v_P_@AM_V@)
+am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_@AM_V@)
+am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
+am__v_GEN_0 = @echo " GEN " $@;
+am__v_GEN_1 =
+AM_V_at = $(am__v_at_@AM_V@)
+am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
+am__v_at_0 = @
+am__v_at_1 =
+DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__maybe_remake_depfiles = depfiles
+am__depfiles_remade = \
+ ./$(DEPDIR)/stat_cmds_unittests-run_unittests.Po \
+ ./$(DEPDIR)/stat_cmds_unittests-stat_cmds_unittest.Po
+am__mv = mv -f
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+LTCXXCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) \
+ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+ $(AM_CXXFLAGS) $(CXXFLAGS)
+AM_V_CXX = $(am__v_CXX_@AM_V@)
+am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@)
+am__v_CXX_0 = @echo " CXX " $@;
+am__v_CXX_1 =
+CXXLD = $(CXX)
+CXXLINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \
+ $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_CXXLD = $(am__v_CXXLD_@AM_V@)
+am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@)
+am__v_CXXLD_0 = @echo " CXXLD " $@;
+am__v_CXXLD_1 =
+SOURCES = $(stat_cmds_unittests_SOURCES)
+DIST_SOURCES = $(am__stat_cmds_unittests_SOURCES_DIST)
+RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \
+ ctags-recursive dvi-recursive html-recursive info-recursive \
+ install-data-recursive install-dvi-recursive \
+ install-exec-recursive install-html-recursive \
+ install-info-recursive install-pdf-recursive \
+ install-ps-recursive install-recursive installcheck-recursive \
+ installdirs-recursive pdf-recursive ps-recursive \
+ tags-recursive uninstall-recursive
+am__can_run_installinfo = \
+ case $$AM_UPDATE_INFO_DIR in \
+ n|no|NO) false;; \
+ *) (install-info --version) >/dev/null 2>&1;; \
+ esac
+RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
+ distclean-recursive maintainer-clean-recursive
+am__recursive_targets = \
+ $(RECURSIVE_TARGETS) \
+ $(RECURSIVE_CLEAN_TARGETS) \
+ $(am__extra_recursive_targets)
+AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
+ distdir distdir-am
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+# Read a list of newline-separated strings from the standard input,
+# and print each of them once, without duplicates. Input order is
+# *not* preserved.
+am__uniquify_input = $(AWK) '\
+ BEGIN { nonempty = 0; } \
+ { items[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in items) print i; }; } \
+'
+# Make sure the list of sources is unique. This is necessary because,
+# e.g., the same source file might be shared among _SOURCES variables
+# for different programs/libraries.
+am__define_uniq_tagged_files = \
+ list='$(am__tagged_files)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | $(am__uniquify_input)`
+ETAGS = etags
+CTAGS = ctags
+am__tty_colors_dummy = \
+ mgn= red= grn= lgn= blu= brg= std=; \
+ am__color_tests=no
+am__tty_colors = { \
+ $(am__tty_colors_dummy); \
+ if test "X$(AM_COLOR_TESTS)" = Xno; then \
+ am__color_tests=no; \
+ elif test "X$(AM_COLOR_TESTS)" = Xalways; then \
+ am__color_tests=yes; \
+ elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \
+ am__color_tests=yes; \
+ fi; \
+ if test $$am__color_tests = yes; then \
+ red=''; \
+ grn=''; \
+ lgn=''; \
+ blu=''; \
+ mgn=''; \
+ brg=''; \
+ std=''; \
+ fi; \
+}
+DIST_SUBDIRS = $(SUBDIRS)
+am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+am__relativize = \
+ dir0=`pwd`; \
+ sed_first='s,^\([^/]*\)/.*$$,\1,'; \
+ sed_rest='s,^[^/]*/*,,'; \
+ sed_last='s,^.*/\([^/]*\)$$,\1,'; \
+ sed_butlast='s,/*[^/]*$$,,'; \
+ while test -n "$$dir1"; do \
+ first=`echo "$$dir1" | sed -e "$$sed_first"`; \
+ if test "$$first" != "."; then \
+ if test "$$first" = ".."; then \
+ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
+ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
+ else \
+ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
+ if test "$$first2" = "$$first"; then \
+ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
+ else \
+ dir2="../$$dir2"; \
+ fi; \
+ dir0="$$dir0"/"$$first"; \
+ fi; \
+ fi; \
+ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
+ done; \
+ reldir="$$dir2"
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+ASCIIDOC = @ASCIIDOC@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BOOST_INCLUDES = @BOOST_INCLUDES@
+BOOST_LIBS = @BOOST_LIBS@
+BOTAN_TOOL = @BOTAN_TOOL@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CONTRIB_DIR = @CONTRIB_DIR@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CRYPTO_CFLAGS = @CRYPTO_CFLAGS@
+CRYPTO_INCLUDES = @CRYPTO_INCLUDES@
+CRYPTO_LDFLAGS = @CRYPTO_LDFLAGS@
+CRYPTO_LIBS = @CRYPTO_LIBS@
+CRYPTO_PACKAGE = @CRYPTO_PACKAGE@
+CRYPTO_RPATH = @CRYPTO_RPATH@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DISTCHECK_BOOST_CONFIGURE_FLAG = @DISTCHECK_BOOST_CONFIGURE_FLAG@
+DISTCHECK_CONTRIB_CONFIGURE_FLAG = @DISTCHECK_CONTRIB_CONFIGURE_FLAG@
+DISTCHECK_CRYPTO_CONFIGURE_FLAG = @DISTCHECK_CRYPTO_CONFIGURE_FLAG@
+DISTCHECK_GSSAPI_CONFIGURE_FLAG = @DISTCHECK_GSSAPI_CONFIGURE_FLAG@
+DISTCHECK_GTEST_CONFIGURE_FLAG = @DISTCHECK_GTEST_CONFIGURE_FLAG@
+DISTCHECK_KEA_SHELL_CONFIGURE_FLAG = @DISTCHECK_KEA_SHELL_CONFIGURE_FLAG@
+DISTCHECK_LIBYANGCPP_CONFIGURE_FLAG = @DISTCHECK_LIBYANGCPP_CONFIGURE_FLAG@
+DISTCHECK_LIBYANG_CONFIGURE_FLAG = @DISTCHECK_LIBYANG_CONFIGURE_FLAG@
+DISTCHECK_LOG4CPLUS_CONFIGURE_FLAG = @DISTCHECK_LOG4CPLUS_CONFIGURE_FLAG@
+DISTCHECK_MYSQL_CONFIGURE_FLAG = @DISTCHECK_MYSQL_CONFIGURE_FLAG@
+DISTCHECK_PERFDHCP_CONFIGURE_FLAG = @DISTCHECK_PERFDHCP_CONFIGURE_FLAG@
+DISTCHECK_PGSQL_CONFIGURE_FLAG = @DISTCHECK_PGSQL_CONFIGURE_FLAG@
+DISTCHECK_PREMIUM_CONFIGURE_FLAG = @DISTCHECK_PREMIUM_CONFIGURE_FLAG@
+DISTCHECK_SYSREPOCPP_CONFIGURE_FLAG = @DISTCHECK_SYSREPOCPP_CONFIGURE_FLAG@
+DISTCHECK_SYSREPO_CONFIGURE_FLAG = @DISTCHECK_SYSREPO_CONFIGURE_FLAG@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GENHTML = @GENHTML@
+GREP = @GREP@
+GSSAPI_CFLAGS = @GSSAPI_CFLAGS@
+GSSAPI_LIBS = @GSSAPI_LIBS@
+GTEST_CONFIG = @GTEST_CONFIG@
+GTEST_INCLUDES = @GTEST_INCLUDES@
+GTEST_LDADD = @GTEST_LDADD@
+GTEST_LDFLAGS = @GTEST_LDFLAGS@
+GTEST_SOURCE = @GTEST_SOURCE@
+HAVE_NETCONF = @HAVE_NETCONF@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+KEA_CXXFLAGS = @KEA_CXXFLAGS@
+KEA_SRCID = @KEA_SRCID@
+KRB5_CONFIG = @KRB5_CONFIG@
+LCOV = @LCOV@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LEX = @LEX@
+LEXLIB = @LEXLIB@
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIBYANGCPP_CPPFLAGS = @LIBYANGCPP_CPPFLAGS@
+LIBYANGCPP_INCLUDEDIR = @LIBYANGCPP_INCLUDEDIR@
+LIBYANGCPP_LIBS = @LIBYANGCPP_LIBS@
+LIBYANGCPP_PREFIX = @LIBYANGCPP_PREFIX@
+LIBYANGCPP_VERSION = @LIBYANGCPP_VERSION@
+LIBYANG_CPPFLAGS = @LIBYANG_CPPFLAGS@
+LIBYANG_INCLUDEDIR = @LIBYANG_INCLUDEDIR@
+LIBYANG_LIBS = @LIBYANG_LIBS@
+LIBYANG_PREFIX = @LIBYANG_PREFIX@
+LIBYANG_VERSION = @LIBYANG_VERSION@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LOG4CPLUS_INCLUDES = @LOG4CPLUS_INCLUDES@
+LOG4CPLUS_LIBS = @LOG4CPLUS_LIBS@
+LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+MYSQL_CPPFLAGS = @MYSQL_CPPFLAGS@
+MYSQL_LIBS = @MYSQL_LIBS@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PACKAGE_VERSION_TYPE = @PACKAGE_VERSION_TYPE@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PDFLATEX = @PDFLATEX@
+PERL = @PERL@
+PGSQL_CPPFLAGS = @PGSQL_CPPFLAGS@
+PGSQL_LIBS = @PGSQL_LIBS@
+PKGPYTHONDIR = @PKGPYTHONDIR@
+PKG_CONFIG = @PKG_CONFIG@
+PLANTUML = @PLANTUML@
+PREMIUM_DIR = @PREMIUM_DIR@
+PYTHON = @PYTHON@
+PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
+PYTHON_PLATFORM = @PYTHON_PLATFORM@
+PYTHON_PREFIX = @PYTHON_PREFIX@
+PYTHON_VERSION = @PYTHON_VERSION@
+RANLIB = @RANLIB@
+SED = @SED@
+SEP = @SEP@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SPHINXBUILD = @SPHINXBUILD@
+SRPD_PLUGINS_PATH = @SRPD_PLUGINS_PATH@
+SR_PLUGINS_PATH = @SR_PLUGINS_PATH@
+SR_REPO_PATH = @SR_REPO_PATH@
+STRIP = @STRIP@
+SYSREPOCPP_CPPFLAGS = @SYSREPOCPP_CPPFLAGS@
+SYSREPOCPP_INCLUDEDIR = @SYSREPOCPP_INCLUDEDIR@
+SYSREPOCPP_LIBS = @SYSREPOCPP_LIBS@
+SYSREPOCPP_PREFIX = @SYSREPOCPP_PREFIX@
+SYSREPOCPP_VERSION = @SYSREPOCPP_VERSION@
+SYSREPO_CPPFLAGS = @SYSREPO_CPPFLAGS@
+SYSREPO_INCLUDEDIR = @SYSREPO_INCLUDEDIR@
+SYSREPO_LIBS = @SYSREPO_LIBS@
+SYSREPO_PREFIX = @SYSREPO_PREFIX@
+SYSREPO_VERSION = @SYSREPO_VERSION@
+USE_LCOV = @USE_LCOV@
+VALGRIND = @VALGRIND@
+VERSION = @VERSION@
+WARNING_GCC_44_STRICT_ALIASING_CFLAG = @WARNING_GCC_44_STRICT_ALIASING_CFLAG@
+YACC = @YACC@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+pkgpyexecdir = @pkgpyexecdir@
+pkgpythondir = @pkgpythondir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+pyexecdir = @pyexecdir@
+pythondir = @pythondir@
+runstatedir = @runstatedir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+SUBDIRS = .
+AM_CPPFLAGS = -I$(top_builddir)/src/lib -I$(top_srcdir)/src/lib \
+ -I$(top_builddir)/src/hooks/dhcp/stat_cmds \
+ -I$(top_srcdir)/src/hooks/dhcp/stat_cmds $(BOOST_INCLUDES) \
+ -DSTAT_CMDS_LIB_SO=\"$(abs_top_builddir)/src/hooks/dhcp/stat_cmds/.libs/libdhcp_stat_cmds.so\" \
+ -DINSTALL_PROG=\"$(abs_top_srcdir)/install-sh\" \
+ $(am__append_1) $(am__append_2)
+AM_CXXFLAGS = $(KEA_CXXFLAGS)
+@USE_STATIC_LINK_TRUE@AM_LDFLAGS = -static
+
+# Unit test data files need to get installed.
+EXTRA_DIST =
+CLEANFILES = *.gcno *.gcda
+TESTS_ENVIRONMENT = $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND)
+LOG_COMPILER = $(LIBTOOL)
+AM_LOG_FLAGS = --mode=execute
+@HAVE_GTEST_TRUE@stat_cmds_unittests_SOURCES = run_unittests.cc \
+@HAVE_GTEST_TRUE@ stat_cmds_unittest.cc
+@HAVE_GTEST_TRUE@stat_cmds_unittests_CPPFLAGS = $(AM_CPPFLAGS) $(GTEST_INCLUDES) $(LOG4CPLUS_INCLUDES)
+@HAVE_GTEST_TRUE@stat_cmds_unittests_LDFLAGS = $(AM_LDFLAGS) \
+@HAVE_GTEST_TRUE@ $(CRYPTO_LDFLAGS) $(GTEST_LDFLAGS) \
+@HAVE_GTEST_TRUE@ $(am__append_4) $(am__append_5)
+@HAVE_GTEST_TRUE@stat_cmds_unittests_CXXFLAGS = $(AM_CXXFLAGS)
+@HAVE_GTEST_TRUE@stat_cmds_unittests_LDADD = $(top_builddir)/src/lib/dhcpsrv/libkea-dhcpsrv.la \
+@HAVE_GTEST_TRUE@ $(top_builddir)/src/lib/process/libkea-process.la \
+@HAVE_GTEST_TRUE@ $(top_builddir)/src/lib/eval/libkea-eval.la \
+@HAVE_GTEST_TRUE@ $(top_builddir)/src/lib/dhcp_ddns/libkea-dhcp_ddns.la \
+@HAVE_GTEST_TRUE@ $(top_builddir)/src/lib/stats/libkea-stats.la \
+@HAVE_GTEST_TRUE@ $(top_builddir)/src/lib/config/libkea-cfgclient.la \
+@HAVE_GTEST_TRUE@ $(top_builddir)/src/lib/http/libkea-http.la \
+@HAVE_GTEST_TRUE@ $(top_builddir)/src/lib/dhcp/libkea-dhcp++.la \
+@HAVE_GTEST_TRUE@ $(top_builddir)/src/lib/hooks/libkea-hooks.la \
+@HAVE_GTEST_TRUE@ $(top_builddir)/src/lib/database/libkea-database.la \
+@HAVE_GTEST_TRUE@ $(top_builddir)/src/lib/cc/libkea-cc.la \
+@HAVE_GTEST_TRUE@ $(top_builddir)/src/lib/asiolink/libkea-asiolink.la \
+@HAVE_GTEST_TRUE@ $(top_builddir)/src/lib/dns/libkea-dns++.la \
+@HAVE_GTEST_TRUE@ $(top_builddir)/src/lib/cryptolink/libkea-cryptolink.la \
+@HAVE_GTEST_TRUE@ $(top_builddir)/src/lib/log/libkea-log.la \
+@HAVE_GTEST_TRUE@ $(top_builddir)/src/lib/util/libkea-util.la \
+@HAVE_GTEST_TRUE@ $(top_builddir)/src/lib/exceptions/libkea-exceptions.la \
+@HAVE_GTEST_TRUE@ $(LOG4CPLUS_LIBS) $(CRYPTO_LIBS) \
+@HAVE_GTEST_TRUE@ $(BOOST_LIBS) $(GTEST_LDADD)
+all: all-recursive
+
+.SUFFIXES:
+.SUFFIXES: .cc .lo .o .obj
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+ && { if test -f $@; then exit 0; else break; fi; }; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/hooks/dhcp/stat_cmds/tests/Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --foreign src/hooks/dhcp/stat_cmds/tests/Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+
+clean-noinstPROGRAMS:
+ @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \
+ echo " rm -f" $$list; \
+ rm -f $$list || exit $$?; \
+ test -n "$(EXEEXT)" || exit 0; \
+ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
+ echo " rm -f" $$list; \
+ rm -f $$list
+
+stat_cmds_unittests$(EXEEXT): $(stat_cmds_unittests_OBJECTS) $(stat_cmds_unittests_DEPENDENCIES) $(EXTRA_stat_cmds_unittests_DEPENDENCIES)
+ @rm -f stat_cmds_unittests$(EXEEXT)
+ $(AM_V_CXXLD)$(stat_cmds_unittests_LINK) $(stat_cmds_unittests_OBJECTS) $(stat_cmds_unittests_LDADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stat_cmds_unittests-run_unittests.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stat_cmds_unittests-stat_cmds_unittest.Po@am__quote@ # am--include-marker
+
+$(am__depfiles_remade):
+ @$(MKDIR_P) $(@D)
+ @echo '# dummy' >$@-t && $(am__mv) $@-t $@
+
+am--depfiles: $(am__depfiles_remade)
+
+.cc.o:
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $<
+
+.cc.obj:
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cc.lo:
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LTCXXCOMPILE) -c -o $@ $<
+
+stat_cmds_unittests-run_unittests.o: run_unittests.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(stat_cmds_unittests_CPPFLAGS) $(CPPFLAGS) $(stat_cmds_unittests_CXXFLAGS) $(CXXFLAGS) -MT stat_cmds_unittests-run_unittests.o -MD -MP -MF $(DEPDIR)/stat_cmds_unittests-run_unittests.Tpo -c -o stat_cmds_unittests-run_unittests.o `test -f 'run_unittests.cc' || echo '$(srcdir)/'`run_unittests.cc
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/stat_cmds_unittests-run_unittests.Tpo $(DEPDIR)/stat_cmds_unittests-run_unittests.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='run_unittests.cc' object='stat_cmds_unittests-run_unittests.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(stat_cmds_unittests_CPPFLAGS) $(CPPFLAGS) $(stat_cmds_unittests_CXXFLAGS) $(CXXFLAGS) -c -o stat_cmds_unittests-run_unittests.o `test -f 'run_unittests.cc' || echo '$(srcdir)/'`run_unittests.cc
+
+stat_cmds_unittests-run_unittests.obj: run_unittests.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(stat_cmds_unittests_CPPFLAGS) $(CPPFLAGS) $(stat_cmds_unittests_CXXFLAGS) $(CXXFLAGS) -MT stat_cmds_unittests-run_unittests.obj -MD -MP -MF $(DEPDIR)/stat_cmds_unittests-run_unittests.Tpo -c -o stat_cmds_unittests-run_unittests.obj `if test -f 'run_unittests.cc'; then $(CYGPATH_W) 'run_unittests.cc'; else $(CYGPATH_W) '$(srcdir)/run_unittests.cc'; fi`
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/stat_cmds_unittests-run_unittests.Tpo $(DEPDIR)/stat_cmds_unittests-run_unittests.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='run_unittests.cc' object='stat_cmds_unittests-run_unittests.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(stat_cmds_unittests_CPPFLAGS) $(CPPFLAGS) $(stat_cmds_unittests_CXXFLAGS) $(CXXFLAGS) -c -o stat_cmds_unittests-run_unittests.obj `if test -f 'run_unittests.cc'; then $(CYGPATH_W) 'run_unittests.cc'; else $(CYGPATH_W) '$(srcdir)/run_unittests.cc'; fi`
+
+stat_cmds_unittests-stat_cmds_unittest.o: stat_cmds_unittest.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(stat_cmds_unittests_CPPFLAGS) $(CPPFLAGS) $(stat_cmds_unittests_CXXFLAGS) $(CXXFLAGS) -MT stat_cmds_unittests-stat_cmds_unittest.o -MD -MP -MF $(DEPDIR)/stat_cmds_unittests-stat_cmds_unittest.Tpo -c -o stat_cmds_unittests-stat_cmds_unittest.o `test -f 'stat_cmds_unittest.cc' || echo '$(srcdir)/'`stat_cmds_unittest.cc
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/stat_cmds_unittests-stat_cmds_unittest.Tpo $(DEPDIR)/stat_cmds_unittests-stat_cmds_unittest.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='stat_cmds_unittest.cc' object='stat_cmds_unittests-stat_cmds_unittest.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(stat_cmds_unittests_CPPFLAGS) $(CPPFLAGS) $(stat_cmds_unittests_CXXFLAGS) $(CXXFLAGS) -c -o stat_cmds_unittests-stat_cmds_unittest.o `test -f 'stat_cmds_unittest.cc' || echo '$(srcdir)/'`stat_cmds_unittest.cc
+
+stat_cmds_unittests-stat_cmds_unittest.obj: stat_cmds_unittest.cc
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(stat_cmds_unittests_CPPFLAGS) $(CPPFLAGS) $(stat_cmds_unittests_CXXFLAGS) $(CXXFLAGS) -MT stat_cmds_unittests-stat_cmds_unittest.obj -MD -MP -MF $(DEPDIR)/stat_cmds_unittests-stat_cmds_unittest.Tpo -c -o stat_cmds_unittests-stat_cmds_unittest.obj `if test -f 'stat_cmds_unittest.cc'; then $(CYGPATH_W) 'stat_cmds_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/stat_cmds_unittest.cc'; fi`
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/stat_cmds_unittests-stat_cmds_unittest.Tpo $(DEPDIR)/stat_cmds_unittests-stat_cmds_unittest.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='stat_cmds_unittest.cc' object='stat_cmds_unittests-stat_cmds_unittest.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(stat_cmds_unittests_CPPFLAGS) $(CPPFLAGS) $(stat_cmds_unittests_CXXFLAGS) $(CXXFLAGS) -c -o stat_cmds_unittests-stat_cmds_unittest.obj `if test -f 'stat_cmds_unittest.cc'; then $(CYGPATH_W) 'stat_cmds_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/stat_cmds_unittest.cc'; fi`
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run 'make' without going through this Makefile.
+# To change the values of 'make' variables: instead of editing Makefiles,
+# (1) if the variable is set in 'config.status', edit 'config.status'
+# (which will cause the Makefiles to be regenerated when you run 'make');
+# (2) otherwise, pass the desired values on the 'make' command line.
+$(am__recursive_targets):
+ @fail=; \
+ if $(am__make_keepgoing); then \
+ failcom='fail=yes'; \
+ else \
+ failcom='exit 1'; \
+ fi; \
+ dot_seen=no; \
+ target=`echo $@ | sed s/-recursive//`; \
+ case "$@" in \
+ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+ *) list='$(SUBDIRS)' ;; \
+ esac; \
+ for subdir in $$list; do \
+ echo "Making $$target in $$subdir"; \
+ if test "$$subdir" = "."; then \
+ dot_seen=yes; \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || eval $$failcom; \
+ done; \
+ if test "$$dot_seen" = "no"; then \
+ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+ fi; test -z "$$fail"
+
+ID: $(am__tagged_files)
+ $(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-recursive
+TAGS: tags
+
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+ set x; \
+ here=`pwd`; \
+ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+ include_option=--etags-include; \
+ empty_fix=.; \
+ else \
+ include_option=--include; \
+ empty_fix=; \
+ fi; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ test ! -f $$subdir/TAGS || \
+ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
+ fi; \
+ done; \
+ $(am__define_uniq_tagged_files); \
+ shift; \
+ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ if test $$# -gt 0; then \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ "$$@" $$unique; \
+ else \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$unique; \
+ fi; \
+ fi
+ctags: ctags-recursive
+
+CTAGS: ctags
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+ $(am__define_uniq_tagged_files); \
+ test -z "$(CTAGS_ARGS)$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && $(am__cd) $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) "$$here"
+cscopelist: cscopelist-recursive
+
+cscopelist-am: $(am__tagged_files)
+ list='$(am__tagged_files)'; \
+ case "$(srcdir)" in \
+ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+ *) sdir=$(subdir)/$(srcdir) ;; \
+ esac; \
+ for i in $$list; do \
+ if test -f "$$i"; then \
+ echo "$(subdir)/$$i"; \
+ else \
+ echo "$$sdir/$$i"; \
+ fi; \
+ done >> $(top_builddir)/cscope.files
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+check-TESTS: $(TESTS)
+ @failed=0; all=0; xfail=0; xpass=0; skip=0; \
+ srcdir=$(srcdir); export srcdir; \
+ list=' $(TESTS) '; \
+ $(am__tty_colors); \
+ if test -n "$$list"; then \
+ for tst in $$list; do \
+ if test -f ./$$tst; then dir=./; \
+ elif test -f $$tst; then dir=; \
+ else dir="$(srcdir)/"; fi; \
+ if $(TESTS_ENVIRONMENT) $${dir}$$tst $(AM_TESTS_FD_REDIRECT); then \
+ all=`expr $$all + 1`; \
+ case " $(XFAIL_TESTS) " in \
+ *[\ \ ]$$tst[\ \ ]*) \
+ xpass=`expr $$xpass + 1`; \
+ failed=`expr $$failed + 1`; \
+ col=$$red; res=XPASS; \
+ ;; \
+ *) \
+ col=$$grn; res=PASS; \
+ ;; \
+ esac; \
+ elif test $$? -ne 77; then \
+ all=`expr $$all + 1`; \
+ case " $(XFAIL_TESTS) " in \
+ *[\ \ ]$$tst[\ \ ]*) \
+ xfail=`expr $$xfail + 1`; \
+ col=$$lgn; res=XFAIL; \
+ ;; \
+ *) \
+ failed=`expr $$failed + 1`; \
+ col=$$red; res=FAIL; \
+ ;; \
+ esac; \
+ else \
+ skip=`expr $$skip + 1`; \
+ col=$$blu; res=SKIP; \
+ fi; \
+ echo "$${col}$$res$${std}: $$tst"; \
+ done; \
+ if test "$$all" -eq 1; then \
+ tests="test"; \
+ All=""; \
+ else \
+ tests="tests"; \
+ All="All "; \
+ fi; \
+ if test "$$failed" -eq 0; then \
+ if test "$$xfail" -eq 0; then \
+ banner="$$All$$all $$tests passed"; \
+ else \
+ if test "$$xfail" -eq 1; then failures=failure; else failures=failures; fi; \
+ banner="$$All$$all $$tests behaved as expected ($$xfail expected $$failures)"; \
+ fi; \
+ else \
+ if test "$$xpass" -eq 0; then \
+ banner="$$failed of $$all $$tests failed"; \
+ else \
+ if test "$$xpass" -eq 1; then passes=pass; else passes=passes; fi; \
+ banner="$$failed of $$all $$tests did not behave as expected ($$xpass unexpected $$passes)"; \
+ fi; \
+ fi; \
+ dashes="$$banner"; \
+ skipped=""; \
+ if test "$$skip" -ne 0; then \
+ if test "$$skip" -eq 1; then \
+ skipped="($$skip test was not run)"; \
+ else \
+ skipped="($$skip tests were not run)"; \
+ fi; \
+ test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \
+ dashes="$$skipped"; \
+ fi; \
+ report=""; \
+ if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \
+ report="Please report to $(PACKAGE_BUGREPORT)"; \
+ test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \
+ dashes="$$report"; \
+ fi; \
+ dashes=`echo "$$dashes" | sed s/./=/g`; \
+ if test "$$failed" -eq 0; then \
+ col="$$grn"; \
+ else \
+ col="$$red"; \
+ fi; \
+ echo "$${col}$$dashes$${std}"; \
+ echo "$${col}$$banner$${std}"; \
+ test -z "$$skipped" || echo "$${col}$$skipped$${std}"; \
+ test -z "$$report" || echo "$${col}$$report$${std}"; \
+ echo "$${col}$$dashes$${std}"; \
+ test "$$failed" -eq 0; \
+ else :; fi
+
+distdir: $(BUILT_SOURCES)
+ $(MAKE) $(AM_MAKEFLAGS) distdir-am
+
+distdir-am: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d "$(distdir)/$$file"; then \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+ else \
+ test -f "$(distdir)/$$file" \
+ || cp -p $$d/$$file "$(distdir)/$$file" \
+ || exit 1; \
+ fi; \
+ done
+ @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ $(am__make_dryrun) \
+ || test -d "$(distdir)/$$subdir" \
+ || $(MKDIR_P) "$(distdir)/$$subdir" \
+ || exit 1; \
+ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
+ $(am__relativize); \
+ new_distdir=$$reldir; \
+ dir1=$$subdir; dir2="$(top_distdir)"; \
+ $(am__relativize); \
+ new_top_distdir=$$reldir; \
+ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
+ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
+ ($(am__cd) $$subdir && \
+ $(MAKE) $(AM_MAKEFLAGS) \
+ top_distdir="$$new_top_distdir" \
+ distdir="$$new_distdir" \
+ am__remove_distdir=: \
+ am__skip_length_check=: \
+ am__skip_mode_fix=: \
+ distdir) \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+ $(MAKE) $(AM_MAKEFLAGS) check-TESTS
+check: check-recursive
+all-am: Makefile $(PROGRAMS)
+installdirs: installdirs-recursive
+installdirs-am:
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+ if test -z '$(STRIP)'; then \
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ install; \
+ else \
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+ fi
+mostlyclean-generic:
+
+clean-generic:
+ -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+ -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
+
+clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \
+ mostlyclean-am
+
+distclean: distclean-recursive
+ -rm -f ./$(DEPDIR)/stat_cmds_unittests-run_unittests.Po
+ -rm -f ./$(DEPDIR)/stat_cmds_unittests-stat_cmds_unittest.Po
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+html-am:
+
+info: info-recursive
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-recursive
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-recursive
+
+install-html-am:
+
+install-info: install-info-recursive
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-recursive
+
+install-pdf-am:
+
+install-ps: install-ps-recursive
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+ -rm -f ./$(DEPDIR)/stat_cmds_unittests-run_unittests.Po
+ -rm -f ./$(DEPDIR)/stat_cmds_unittests-stat_cmds_unittest.Po
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+ mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: $(am__recursive_targets) check-am install-am install-strip
+
+.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \
+ am--depfiles check check-TESTS check-am clean clean-generic \
+ clean-libtool clean-noinstPROGRAMS cscopelist-am ctags \
+ ctags-am distclean distclean-compile distclean-generic \
+ distclean-libtool distclean-tags distdir dvi dvi-am html \
+ html-am info info-am install install-am install-data \
+ install-data-am install-dvi install-dvi-am install-exec \
+ install-exec-am install-html install-html-am install-info \
+ install-info-am install-man install-pdf install-pdf-am \
+ install-ps install-ps-am install-strip installcheck \
+ installcheck-am installdirs installdirs-am maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-compile \
+ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+ tags tags-am uninstall uninstall-am
+
+.PRECIOUS: Makefile
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/src/hooks/dhcp/stat_cmds/tests/run_unittests.cc b/src/hooks/dhcp/stat_cmds/tests/run_unittests.cc
new file mode 100644
index 0000000..f5014ce
--- /dev/null
+++ b/src/hooks/dhcp/stat_cmds/tests/run_unittests.cc
@@ -0,0 +1,19 @@
+// Copyright (C) 2018 Internet Systems Consortium, Inc. ("ISC")
+//
+// This Source Code Form is subject to the terms of the Mozilla Public
+// License, v. 2.0. If a copy of the MPL was not distributed with this
+// file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+#include <config.h>
+
+#include <log/logger_support.h>
+#include <gtest/gtest.h>
+
+int
+main(int argc, char* argv[]) {
+ ::testing::InitGoogleTest(&argc, argv);
+ isc::log::initLogger();
+ int result = RUN_ALL_TESTS();
+
+ return (result);
+}
diff --git a/src/hooks/dhcp/stat_cmds/tests/stat_cmds_unittest.cc b/src/hooks/dhcp/stat_cmds/tests/stat_cmds_unittest.cc
new file mode 100644
index 0000000..8037209
--- /dev/null
+++ b/src/hooks/dhcp/stat_cmds/tests/stat_cmds_unittest.cc
@@ -0,0 +1,1605 @@
+// Copyright (C) 2018-2023 Internet Systems Consortium, Inc. ("ISC")
+//
+// This Source Code Form is subject to the terms of the Mozilla Public
+// License, v. 2.0. If a copy of the MPL was not distributed with this
+// file, You can obtain one at http://mozilla.org/MPL/2.0/.
+//
+
+#include <config.h>
+
+#include <exceptions/exceptions.h>
+#include <hooks/hooks_manager.h>
+#include <config/command_mgr.h>
+#include <dhcpsrv/cfgmgr.h>
+#include <dhcpsrv/lease_mgr.h>
+#include <dhcpsrv/lease_mgr_factory.h>
+#include <cc/command_interpreter.h>
+#include <cc/data.h>
+#include <process/daemon.h>
+#include <stats/stats_mgr.h>
+#include <testutils/gtest_utils.h>
+
+#include <boost/date_time/posix_time/posix_time.hpp>
+#include <gtest/gtest.h>
+#include <time.h>
+
+using namespace std;
+using namespace isc;
+using namespace isc::asiolink;
+using namespace isc::config;
+using namespace isc::data;
+using namespace isc::dhcp;
+using namespace isc::hooks;
+using namespace isc::process;
+using namespace isc::stats;
+using namespace boost::posix_time;
+
+namespace {
+
+/// @brief Test fixture for testing loading and unloading the library
+class LibLoadTest : public ::testing::Test {
+public:
+ /// @brief Constructor
+ LibLoadTest(std::string lib_filename)
+ : lib_name_(lib_filename), start_time_(second_clock::universal_time()) {
+ CommandMgr::instance();
+ unloadLibs();
+ }
+
+ /// @brief Destructor
+ /// Removes files that may be left over from previous tests
+ virtual ~LibLoadTest() {
+ unloadLibs();
+ }
+
+ /// @brief Set family.
+ void setFamily(uint16_t family = AF_INET) {
+ CfgMgr::instance().setFamily(family);
+ if (family == AF_INET) {
+ Daemon::setProcName("kea-dhcp4");
+ } else {
+ Daemon::setProcName("kea-dhcp6");
+ }
+ }
+
+ /// @brief Adds library/parameters to list of libraries to be loaded
+ void addLib(const std::string& lib, ConstElementPtr params) {
+ libraries_.push_back(make_pair(lib, params));
+ }
+
+ /// @brief Load all specified libraries.
+ ///
+ /// The libraries are stored in libraries
+ void loadLibs() {
+ ASSERT_TRUE(HooksManager::loadLibraries(libraries_))
+ << "library loading failed";
+ }
+
+ /// @brief Unloads all libraries.
+ void unloadLibs() {
+ ASSERT_NO_THROW(HooksManager::unloadLibraries());
+ }
+
+ /// @brief Checks whether specified command is registered
+ ///
+ /// @param name name of the command to be checked
+ /// @param expect_true true - must be registered, false - must not be
+ void checkCommandRegistered(const std::string& name, bool expect_true) {
+
+ // First get the list of registered commands
+ ConstElementPtr lst = Element::fromJSON("{ \"command\": \"list-commands\" }");
+ ConstElementPtr rsp = CommandMgr::instance().processCommand(lst);
+
+ ASSERT_TRUE(rsp);
+
+ ConstElementPtr args = rsp->get("arguments");
+ ASSERT_TRUE(args);
+
+ string args_txt = args->str();
+
+ if (expect_true) {
+ EXPECT_TRUE(args_txt.find(name) != string::npos);
+ } else {
+ EXPECT_TRUE(args_txt.find(name) == string::npos);
+ } }
+
+ /// @brief tests specified command and verifies response
+ ///
+ /// This method loads the library, sends specific command,
+ /// then checks if the result is as expected, checks if text response
+ /// is ok (optional, check skipped if exp_txt is empty) and then returns
+ /// the response (for possible additional checks).
+ ///
+ /// @param cmd JSON command to be sent (must be valid JSON)
+ /// @param exp_result 0 - success, 1 - error, 2 - ...
+ /// @param exp_txt expected text response (optional)
+ void testCommand(string cmd_txt, int exp_result, string exp_txt,
+ string exp_result_json = "") {
+ // Let's load the library first.
+ loadLib();
+
+ ConstElementPtr cmd;
+ ASSERT_NO_THROW(cmd = Element::fromJSON(cmd_txt))
+ << "command JSON invalid, test is broken";
+
+ // Process the command and verify response.
+ ConstElementPtr rsp = CommandMgr::instance().processCommand(cmd);
+ checkAnswer(rsp, exp_result, exp_txt);
+
+ // Don't care about argument contents, we're done.
+ if (exp_result_json.empty()) {
+ return;
+ }
+
+ // Turn expected result JSON into Element tree
+ ConstElementPtr exp_args;
+ ASSERT_NO_THROW(exp_args = Element::fromJSON(exp_result_json))
+ << "Expected result JSON is invalid, test is broken" << exp_result_json;
+
+ ASSERT_TRUE(exp_args->getType() == Element::map)
+ << "Expected args is not a map, test is broken: " << exp_result_json;
+
+ // Fetch "arguments" from the actual response
+ ConstElementPtr actual_args = rsp->get("arguments");
+ ASSERT_TRUE(actual_args && actual_args->getType() == Element::map)
+ << "'arguments' missing or not a map " << toJSON(rsp);
+
+ // If we expect nothing and nothing is what we got, we're done.
+ if (exp_args->size() == 0) {
+ ASSERT_TRUE(actual_args->size() == 0)
+ << "Actual args should be empty:" << toJSON(actual_args);
+ return;
+ }
+
+ // Fetch "result-set" from the expected arguments
+ ConstElementPtr exp_result_set = exp_args->get("result-set");
+ ASSERT_TRUE(exp_result_set && (exp_result_set->getType() == Element::map))
+ << "Expected 'result-set' missing or not map\n" << toJSON(exp_args);
+
+ // Fetch "result-set" from the actual arguments
+ ConstElementPtr actual_result_set = actual_args->get("result-set");
+ ASSERT_TRUE(actual_result_set && (actual_result_set->getType() == Element::map))
+ << "Actual 'result-set' missing or not map\n" << toJSON(actual_args);
+
+ // Compare the actual and expected "columns"
+ ConstElementPtr exp = exp_result_set->get("columns");
+ ASSERT_TRUE(exp && exp->getType() == Element::list)
+ << "Expected 'columns' is missing or not list, test is broken"
+ << toJSON(exp_result_set);
+
+ ConstElementPtr actual = actual_result_set->get("columns");
+ ASSERT_TRUE(actual && (actual->getType() == Element::list))
+ << "Actual 'columns' is missing or not list"
+ << toJSON(actual_result_set);
+
+ ASSERT_TRUE(*exp == *actual) << "Result set columns are wrong\n"
+ << "Expected:\n" << toJSON(exp)
+ << "\nActual:\n" << toJSON(actual);
+
+ // Compare the actual and expected "rows"
+ exp = exp_result_set->get("rows");
+ ASSERT_TRUE(exp && (exp->getType() == Element::list))
+ << "Expected 'rows' is missing or not a list, test is broken";
+
+ actual = actual_result_set->get("rows");
+ ASSERT_TRUE(actual && (actual->getType() == Element::list))
+ << "Actual 'rows' is missing or not a list"
+ << toJSON(actual_result_set);
+
+ ASSERT_TRUE(*exp == *actual) << "Result set rows are wrong\n"
+ << "Expected:\n" << toJSON(exp)
+ << "\nActual:\n" << toJSON(actual);
+
+ // Make sure timestamp is present and appears valid
+ actual = actual_result_set->get("timestamp");
+ ASSERT_TRUE (actual && (actual->getType() == Element::string))
+ << "Actual result-set timestamp is missing?"
+ << toJSON(rsp);
+
+ // We expect it to be the same or later than the test start time
+ ptime timestamp = strToPtime(actual->stringValue());
+ EXPECT_TRUE(timestamp >= start_time_)
+ << "Actual timestamp is wrong?" << actual->stringValue();
+ }
+
+ /// @brief Compares the status in the given parse result to a given value.
+ ///
+ /// @param answer Element set containing an integer response and string
+ /// comment.
+ /// @param exp_status is an integer against which to compare the status.
+ /// @param exp_txt is expected text (not checked if "")
+ void checkAnswer(isc::data::ConstElementPtr answer,
+ int exp_status,
+ string exp_txt = "") {
+ int rcode = 0;
+ isc::data::ConstElementPtr comment;
+ comment = isc::config::parseAnswer(rcode, answer);
+
+ if (rcode != exp_status) {
+ ADD_FAILURE() << "Expected status code " << exp_status
+ << " but received " << rcode << ", comment: "
+ << (comment ? comment->str() : "(none)");
+ }
+
+ // Ok, parseAnswer interface is weird. If there are no arguments,
+ // it returns content of text. But if there is an argument,
+ // it returns the argument and it's not possible to retrieve
+ // "text" (i.e. comment).
+ if (comment->getType() != Element::string) {
+ comment = answer->get("text");
+ }
+
+ if (!exp_txt.empty()) {
+ EXPECT_EQ(exp_txt, comment->stringValue());
+ }
+ }
+
+ /// @brief Loads the library specified by lib_name_
+ void loadLib() {
+ if (libraries_.empty()) {
+ data::ElementPtr params = data::Element::createMap();
+ addLib(lib_name_, params);
+ }
+ EXPECT_NO_THROW(loadLibs());
+ }
+
+ /// @brief Test checks if specified commands are provided by the library.
+ ///
+ /// @param cms a vector of string with command names
+ void testCommands(const std::vector<string> cmds) {
+
+ // The commands should not be registered yet.
+ for (auto cmd = cmds.begin(); cmd != cmds.end(); ++cmd) {
+ checkCommandRegistered(*cmd, false);
+ }
+
+ loadLib();
+
+ // The commands should be available after library was loaded.
+ for (auto cmd = cmds.begin(); cmd != cmds.end(); ++cmd) {
+ checkCommandRegistered(*cmd, true);
+ }
+
+ unloadLibs();
+
+ // and the commands should be gone now.
+ for (auto cmd = cmds.begin(); cmd != cmds.end(); ++cmd) {
+ checkCommandRegistered(*cmd, false);
+ }
+
+ }
+
+ // Check that the library can be loaded and unloaded multiple times.
+ void testMultipleLoads() {
+ EXPECT_NO_THROW(loadLib());
+ EXPECT_NO_THROW(unloadLibs());
+
+ EXPECT_NO_THROW(loadLib());
+ EXPECT_NO_THROW(unloadLibs());
+
+ EXPECT_NO_THROW(loadLib());
+ EXPECT_NO_THROW(unloadLibs());
+
+ EXPECT_NO_THROW(loadLib());
+ EXPECT_NO_THROW(unloadLibs());
+ }
+
+ std::string toJSON(ConstElementPtr element) {
+ std::stringstream os;
+ element->toJSON(os);
+ return (os.str());
+ }
+
+ /// @brief Converts a string into a boost::posix_time::ptime
+ ///
+ /// The expected format of the input string is:
+ ///
+ /// "%Y-%m-%d %H:%M:%S"
+ ///
+ /// Example: "2018-04-21 15:03:37"
+ ///
+ /// Any content beyond this length is ignored.
+ ///
+ /// We're doing it this way because boost's function, time_from_string(),
+ /// is part of their date/time library which is not header only.
+ ///
+ /// @param timestamp string to convert into a ptime
+ /// @throw BadValue if the string cannot be converted into a ptime
+ boost::posix_time::ptime strToPtime(const std::string& timestamp) {
+ struct tm tm_result;
+
+ if (!strptime(timestamp.c_str(), "%Y-%m-%d %H:%M:%S", &tm_result)) {
+ isc_throw(BadValue, "cannot convert timestamp string: " << timestamp);
+ }
+
+ return (ptime_from_tm(tm_result));
+ }
+
+ /// List of libraries to be/being loaded (usually just one)
+ HookLibsCollection libraries_;
+
+ /// Path to the library filename
+ std::string lib_name_;
+
+ /// @brief Holds the time the test started
+ boost::posix_time::ptime start_time_;
+};
+
+/// @brief Class dedicated to testing lease_cmds library.
+///
+/// Provides convenience methods for loading, testing all commands and
+/// unloading the lease_cmds library.
+/// @todo This class should really be separated from loading and unloading
+/// the library so implementation classes are tested more directly.
+class StatCmdsTest : public LibLoadTest {
+public:
+
+ /// @brief Constructor
+ ///
+ /// Sets the library filename and clears the lease manager pointer.
+ /// Also ensured there is no lease manager leftovers from previous
+ /// test.
+ StatCmdsTest()
+ :LibLoadTest(STAT_CMDS_LIB_SO), hwaddr_({10,20,30,40,50,00}),
+ duid_({10,20,30,40,50,60,70,00}) {
+ LeaseMgrFactory::destroy();
+ lmptr_ = 0;
+ }
+
+ /// @brief Destructor
+ ///
+ /// Removes library (if any), destroys lease manager (if any).
+ virtual ~StatCmdsTest() {
+ // destroys lease manager first because the other order triggers
+ // a clang/boost bug
+ LeaseMgrFactory::destroy();
+ unloadLibs();
+ lmptr_ = 0;
+ }
+
+ /// @brief Initializes lease manager for v4 operation
+ ///
+ /// Creates a lease manager (memfile, trimmed down to keep everything in memory
+ /// only) and adds five subnets to the configuration.
+ void initLeaseMgr4() {
+ LeaseMgrFactory::destroy();
+ LeaseMgrFactory::create("type=memfile persist=false universe=4");
+
+ lmptr_ = &(LeaseMgrFactory::instance());
+ ASSERT_TRUE(lmptr_);
+
+ CfgMgr& cfg_mgr = CfgMgr::instance();
+ CfgSubnets4Ptr subnets = cfg_mgr.getStagingCfg()->getCfgSubnets4();
+
+ Subnet4Ptr subnet;
+ Pool4Ptr pool;
+
+ subnet.reset(new Subnet4(IOAddress("192.0.1.0"), 24, 1, 2, 3, 10));
+ pool.reset(new Pool4(IOAddress("192.0.1.0"), 24));
+ subnet->addPool(pool);
+ subnets->add(subnet);
+
+ subnet.reset(new Subnet4(IOAddress("192.0.2.0"), 28, 1, 2, 3, 20));
+ pool.reset(new Pool4(IOAddress("192.0.2.0"), 28));
+ subnet->addPool(pool);
+ subnets->add(subnet);
+
+ subnet.reset(new Subnet4(IOAddress("192.0.3.0"), 24, 1, 2, 3, 30));
+ pool.reset(new Pool4(IOAddress("192.0.3.0"), 24));
+ subnet->addPool(pool);
+ subnets->add(subnet);
+
+ subnet.reset(new Subnet4(IOAddress("192.0.4.0"), 28, 1, 2, 3, 40));
+ pool.reset(new Pool4(IOAddress("192.0.4.0"), 28));
+ subnet->addPool(pool);
+ subnets->add(subnet);
+
+ subnet.reset(new Subnet4(IOAddress("192.0.5.0"), 24, 1, 2, 3, 50));
+ pool.reset(new Pool4(IOAddress("192.0.5.0"), 24));
+ subnet->addPool(pool);
+ subnets->add(subnet);
+
+ cfg_mgr.commit();
+
+ // Subnet 10
+ // 300 cumulative, 2 assigned, 3 declined, 1 expired
+ setSubnetStat(10, "cumulative-assigned-addresses", 300);
+ addLease4("192.0.1.1", 10);
+ addLease4("192.0.1.2", 10, Lease::STATE_DECLINED);
+ addLease4("192.0.1.3", 10, Lease::STATE_DECLINED);
+ addLease4("192.0.1.4", 10, Lease::STATE_DECLINED);
+ addLease4("192.0.1.5", 10);
+ addLease4("192.0.1.6", 10, Lease::STATE_EXPIRED_RECLAIMED);
+
+ // Subnet 20
+ // 10 cumulative, 3 assigned, 0 declined, 2 expired
+ setSubnetStat(20, "cumulative-assigned-addresses", 10);
+ addLease4("192.0.2.1", 20);
+ addLease4("192.0.2.2", 20);
+ addLease4("192.0.2.3", 20);
+ addLease4("192.0.2.4", 20, Lease::STATE_EXPIRED_RECLAIMED);
+ addLease4("192.0.2.5", 20, Lease::STATE_EXPIRED_RECLAIMED);
+
+ // Subnet 30 no leases
+
+ // Subnet 40, 4 cumulative, 4 assigned
+ setSubnetStat(40, "cumulative-assigned-addresses", 4);
+ addLease4("192.0.4.1", 40);
+ addLease4("192.0.4.2", 40);
+ addLease4("192.0.4.3", 40);
+ addLease4("192.0.4.4", 40);
+
+ // Subnet 50, 2 cumulative, 1 assigned, 1 declined
+ setSubnetStat(50, "cumulative-assigned-addresses", 2);
+ addLease4("192.0.5.1", 50);
+ addLease4("192.0.5.2", 50, Lease::STATE_DECLINED);
+ }
+
+ /// @brief Initializes lease manager for v6 operation
+ ///
+ /// Creates a lease manager (memfile, trimmed down to keep everything in
+ /// memory only) and adds five subnets to the configuration.
+ void initLeaseMgr6() {
+ LeaseMgrFactory::destroy();
+ LeaseMgrFactory::create("type=memfile persist=false universe=6");
+
+ lmptr_ = &(LeaseMgrFactory::instance());
+ ASSERT_TRUE(lmptr_);
+
+ CfgMgr& cfg_mgr = CfgMgr::instance();
+ CfgSubnets6Ptr subnets = cfg_mgr.getStagingCfg()->getCfgSubnets6();
+
+ Subnet6Ptr subnet;
+ Pool6Ptr pool;
+
+ subnet.reset(new Subnet6(IOAddress("2001:db8:1::"), 64, 1, 2, 3, 4, 10));
+ pool.reset(new Pool6(Lease::TYPE_NA, IOAddress("2001:db8:1::"), 112));
+ subnet->addPool(pool);
+ subnets->add(subnet);
+
+ subnet.reset(new Subnet6(IOAddress("2001:db8:2::"), 64, 1, 2, 3, 4, 20));
+ pool.reset(new Pool6(Lease::TYPE_NA, IOAddress("2001:db8:2::"), 104));
+ subnet->addPool(pool);
+ subnets->add(subnet);
+
+ subnet.reset(new Subnet6(IOAddress("2001:db8:3::"), 64, 1, 2, 3, 4, 30));
+ pool.reset(new Pool6(Lease::TYPE_NA, IOAddress("2001:db8:3::"), 124));
+ subnet->addPool(pool);
+ pool.reset(new Pool6(Lease::TYPE_PD, IOAddress("3001::"), 96, 112));
+ subnet->addPool(pool);
+ subnets->add(subnet);
+
+ subnet.reset(new Subnet6(IOAddress("2001:db8:4::"), 64, 1, 2, 3, 4, 40));
+ pool.reset(new Pool6(Lease::TYPE_NA, IOAddress("2001:db8:4::"), 104));
+ subnet->addPool(pool);
+ subnets->add(subnet);
+
+ // Subnet 50 is prefix only
+ subnet.reset(new Subnet6(IOAddress("2001:db8:5::"), 64, 1, 2, 3, 4, 50));
+ pool.reset(new Pool6(Lease::TYPE_PD, IOAddress("5001::"), 96, 112));
+ subnet->addPool(pool);
+ subnets->add(subnet);
+
+ cfg_mgr.commit();
+
+ // Subnet 10: 10000 cumulative NAs, 2 assigned, 3 declined, 1 expired
+ setSubnetStat(10, "cumulative-assigned-nas", 10000);
+ addLease6("2001:db8:1::1", 10);
+ addLease6("2001:db8:1::2", 10);
+ addLease6("2001:db8:1::3", 10, Lease::STATE_DECLINED);
+ addLease6("2001:db8:1::4", 10, Lease::STATE_DECLINED);
+ addLease6("2001:db8:1::5", 10, Lease::STATE_DECLINED);
+ addLease6("2001:db8:1::6", 10, Lease::STATE_EXPIRED_RECLAIMED);
+
+ // Subnet 20: 10 cumulative NAs, 3 assigned
+ setSubnetStat(20, "cumulative-assigned-nas", 10);
+ addLease6("2001:db8:2::1", 20);
+ addLease6("2001:db8:2::2", 20);
+ addLease6("2001:db8:2::3", 20);
+
+ // Subnet 30: 2 cumulative NAs, 1 assigned, 1 declined,
+ // 4 cumulative PDs, 3 assigned
+ setSubnetStat(30, "cumulative-assigned-nas", 2);
+ addLease6("2001:db8:3::1", 30);
+ addLease6("2001:db8:3::2", 30, Lease::STATE_DECLINED);
+ setSubnetStat(30, "cumulative-assigned-pds", 4);
+ addPrefix("3001::1:0", 112, 30);
+ addPrefix("3001::2:0", 112, 30);
+ addPrefix("3001::3:0", 112, 30);
+
+ // Subnet 40: no leases
+
+ // Subnet 50: 1000 cumulative PDs, 2 assigned
+ setSubnetStat(50, "cumulative-assigned-pds", 1000);
+ addPrefix("5001::1:0", 112, 50);
+ addPrefix("5001::2:0", 112, 50);
+ }
+
+ /// @brief Creates an IPv4 lease
+ ///
+ /// Lease parameters: valid lifetime = 3600, cltt = 12345678,
+ /// fqdn-fwd = false,fqdn-rev = true, hostname = myhost.example.com
+ ///
+ /// @param ip_address IP address for the lease.
+ /// @param subnet_id subnet identifier
+ /// @param state lease state
+ void addLease4(const std::string& ip_address, const SubnetID& subnet_id,
+ const int state = Lease::STATE_DEFAULT) {
+ Lease4Ptr lease(new Lease4());
+
+ lease->addr_ = IOAddress(ip_address);
+
+ ++hwaddr_[5];
+
+ // Set other parameters. For historical reasons, address 0 is not used.
+ lease->hwaddr_.reset(new HWAddr(hwaddr_, HTYPE_ETHER));
+ lease->valid_lft_ = 3600;
+ lease->cltt_ = 12345678;
+ lease->subnet_id_ = subnet_id;
+ lease->fqdn_fwd_ = false;
+ lease->fqdn_rev_ = true;
+ lease->hostname_ = "myhost.example.com.";
+ lease->state_ = state;
+
+ ASSERT_NO_THROW(lmptr_->addLease(lease))
+ << "cannot add lease4: " << ip_address
+ << " subnet: " << subnet_id;
+ }
+
+ /// @brief Creates an IPv6 lease
+ ///
+ /// @param ip_address IP address for the lease.
+ /// @param subnet_id subnet identifier
+ /// @param state lease state of the lease, defaults to STATE_DEFAULT
+ /// @param lease_type type of the lease, defaults to TYPE_NA
+ /// @param prefix_len prefix length of the lease, defaults to 128
+ void addLease6(const std::string& ip_address, const SubnetID& subnet_id,
+ const int state = Lease::STATE_DEFAULT,
+ const Lease::Type& lease_type = Lease::TYPE_NA,
+ const int prefix_len = 128) {
+ Lease6Ptr lease(new Lease6());
+
+ ++duid_[7];
+
+ lease->addr_ = IOAddress(ip_address);
+ lease->type_ = lease_type;
+ lease->prefixlen_ = prefix_len;
+ lease->iaid_ = 42;
+ lease->duid_ = DuidPtr(new DUID(duid_));
+ lease->preferred_lft_ = 1800;
+ lease->valid_lft_ = 3600;
+ lease->cltt_ = 12345678;
+ lease->subnet_id_ = subnet_id;
+ lease->state_ = state;
+
+ ASSERT_NO_THROW(lmptr_->addLease(lease))
+ << "cannot add lease6: " << lease->toText();
+ }
+
+ /// @brief Creates an IPv6 PD lease
+ ///
+ /// @param prefix IP address prefix for the lease.
+ /// @param prefix_len prefix length of the lease
+ /// @param subnet_id subnet identifier
+ /// @param state lease state of the lease, defaults to STATE_DEFAULT
+ void addPrefix(const std::string& prefix, const int prefix_len,
+ const SubnetID& subnet_id,
+ const int state = Lease::STATE_DEFAULT) {
+ addLease6(prefix, subnet_id, state, Lease::TYPE_PD, prefix_len);
+ }
+
+ /// @brief Creates a statistic
+ ///
+ /// @param subnet_id subnet identifier
+ /// @param name statistic name
+ /// @param value statistic value
+ void setSubnetStat(const SubnetID& subnet_id, const std::string& name,
+ int64_t value) {
+ StatsMgr& stats_mgr = StatsMgr::instance();
+ const std::string& stats_name =
+ stats_mgr.generateName("subnet", subnet_id, name);
+ stats_mgr.setValue(stats_name, value);
+ }
+
+ /// @brief Pointer to the lease manager
+ LeaseMgr* lmptr_;
+
+ /// @brief Holds the hardware address for creating v4 leases
+ vector<uint8_t> hwaddr_;
+
+ /// @brief Holds the DUID for creating v6 leases
+ vector<uint8_t> duid_;
+};
+
+// Simple test that checks the library really registers the commands.
+TEST_F(StatCmdsTest, commands) {
+
+ vector<string> cmds = { "stat-lease4-get",
+ "stat-lease6-get" };
+ setFamily();
+ testCommands(cmds);
+}
+
+// Check that the library can be loaded and unloaded multiple times.
+TEST_F(StatCmdsTest, multipleLoads) {
+ setFamily();
+ testMultipleLoads();
+}
+
+struct TestScenario {
+ std::string description_;
+ std::string command_txt_;
+ std::string exp_response_;
+ std::string exp_result_json;
+};
+
+// Verifies detection of invalid v4 input parameters.
+TEST_F(StatCmdsTest, StatLease4GetBadParams) {
+ setFamily(AF_INET);
+
+ // Initialize lease manager
+ initLeaseMgr4();
+
+ std::vector<TestScenario> tests = {
+ {
+ "arguments is not a map",
+ "{\n"
+ " \"command\": \"stat-lease4-get\",\n"
+ " \"arguments\": \"not a map\"\n"
+ "}",
+ "'arguments' parameter is not a map"
+ },
+ {
+ "subnet-id 0",
+ "{\n"
+ " \"command\": \"stat-lease4-get\",\n"
+ " \"arguments\": {"
+ " \"subnet-id\": 0\n"
+ " }\n"
+ "}",
+ "'subnet-id' parameter must be > 0"
+ },
+
+ {
+ "subnet-id -1",
+ "{\n"
+ " \"command\": \"stat-lease4-get\",\n"
+ " \"arguments\": {"
+ " \"subnet-id\": -1\n"
+ " }\n"
+ "}",
+ "'subnet-id' parameter must be > 0"
+ },
+ {
+ "subnet-id string",
+ "{\n"
+ " \"command\": \"stat-lease4-get\",\n"
+ " \"arguments\": {"
+ " \"subnet-id\": \"boo\"\n"
+ " }\n"
+ "}",
+ "'subnet-id' parameter is not integer"
+ },
+ {
+ "subnet-range not a map",
+ "{\n"
+ " \"command\": \"stat-lease4-get\",\n"
+ " \"arguments\": {"
+ " \"subnet-range\": -1\n"
+ " }\n"
+ "}",
+ "subnet-range parameter is not a map"
+ },
+ {
+ "subnet-range empty",
+ "{\n"
+ " \"command\": \"stat-lease4-get\",\n"
+ " \"arguments\": {"
+ " \"subnet-range\": {\n"
+ " }\n"
+ " }\n"
+ "}",
+ "'first-subnet-id' parameter missing or not an integer"
+ },
+ {
+ "first-subnet-id string",
+ "{\n"
+ " \"command\": \"stat-lease4-get\",\n"
+ " \"arguments\": {"
+ " \"subnet-range\": {\n"
+ " \"first-subnet-id\": \"boo\"\n"
+ " }\n"
+ " }\n"
+ "}",
+ "'first-subnet-id' parameter missing or not an integer"
+ },
+ {
+ "first-subnet-id < 0",
+ "{\n"
+ " \"command\": \"stat-lease4-get\",\n"
+ " \"arguments\": {"
+ " \"subnet-range\": {\n"
+ " \"first-subnet-id\": -77\n"
+ " }\n"
+ " }\n"
+ "}",
+ "'first-subnet-id' parameter must be > 0"
+ },
+ {
+ "last-subnet-id missing",
+ "{\n"
+ " \"command\": \"stat-lease4-get\",\n"
+ " \"arguments\": {"
+ " \"subnet-range\": {\n"
+ " \"first-subnet-id\": 10\n"
+ " }\n"
+ " }\n"
+ "}",
+ "'last-subnet-id' parameter missing or not an integer"
+ },
+ {
+ "last-subnet-id string",
+ "{\n"
+ " \"command\": \"stat-lease4-get\",\n"
+ " \"arguments\": {"
+ " \"subnet-range\": {\n"
+ " \"first-subnet-id\": 10,\n"
+ " \"last-subnet-id\": \"boo\"\n"
+ " }\n"
+ " }\n"
+ "}",
+ "'last-subnet-id' parameter missing or not an integer"
+ },
+ {
+ "last-subnet-id < 0",
+ "{\n"
+ " \"command\": \"stat-lease4-get\",\n"
+ " \"arguments\": {"
+ " \"subnet-range\": {\n"
+ " \"first-subnet-id\": 10,\n"
+ " \"last-subnet-id\": -1\n"
+ " }\n"
+ " }\n"
+ "}",
+ "'last-subnet-id' parameter must be > 0"
+ },
+ {
+ "invalid range",
+ "{\n"
+ " \"command\": \"stat-lease4-get\",\n"
+ " \"arguments\": {"
+ " \"subnet-range\": {\n"
+ " \"first-subnet-id\": 50,\n"
+ " \"last-subnet-id\": 2\n"
+ " }\n"
+ " }\n"
+ "}",
+ "'last-subnet-id' must be greater than 'first-subnet-id'"
+ },
+ {
+ "Subnet-Range: all in the middle",
+ "{\n"
+ " \"command\": \"stat-lease4-get\",\n"
+ " \"arguments\": {"
+ " \"subnet-id\": 10,\n"
+ " \"subnet-range\": {\n"
+ " \"first-subnet-id\": 20,"
+ " \"last-subnet-id\": 40"
+ " }\n"
+ " }\n"
+ "}",
+ "cannot specify both subnet-id and subnet-range"
+ }
+ };
+
+ for (auto test = tests.begin(); test != tests.end(); ++test) {
+ {
+ SCOPED_TRACE((*test).description_);
+ testCommand((*test).command_txt_, CONTROL_RESULT_ERROR,(*test).exp_response_);
+ }
+ }
+}
+
+// Verifies result content for valid v4 statistic commands.
+// These test scenarios are all valid, and not expected to throw.
+TEST_F(StatCmdsTest, statLease4GetValid) {
+ setFamily(AF_INET);
+
+ // Initialize lease manager.
+ initLeaseMgr4();
+
+ // Note timestamp actual values are not important but are included
+ // for clarity.
+ std::vector<TestScenario> tests = {
+ {
+ "ALL-Subnets",
+ "{\n"
+ " \"command\": \"stat-lease4-get\",\n"
+ " \"arguments\": {"
+ " }\n"
+ "}",
+ "stat-lease4-get[all subnets]: 5 rows found",
+ "{\n"
+ "\"result-set\": {\n"
+ " \"columns\": [\n"
+ " \"subnet-id\", \"total-addresses\",\n"
+ " \"cumulative-assigned-addresses\",\n"
+ " \"assigned-addresses\", \"declined-addresses\"\n"
+ " ],\n"
+ " \"rows\": [\n"
+ " [ 10, 256, 300, 2, 3 ],\n"
+ " [ 20, 16, 10, 3, 0 ],\n"
+ " [ 30, 256, 0, 0, 0 ],\n"
+ " [ 40, 16, 4, 4, 0 ],\n"
+ " [ 50, 256, 2, 1, 1 ]\n"
+ " ],\n"
+ " \"timestamp\": \"2018-05-04 15:03:37.000000\" }\n"
+ "}\n"
+ },
+ {
+ "ALL-Subnets - arguments omitted",
+ "{\n"
+ " \"command\": \"stat-lease4-get\"\n"
+ "}",
+ "stat-lease4-get[all subnets]: 5 rows found",
+ "{\n"
+ "\"result-set\": {\n"
+ " \"columns\": [\n"
+ " \"subnet-id\", \"total-addresses\",\n"
+ " \"cumulative-assigned-addresses\",\n"
+ " \"assigned-addresses\", \"declined-addresses\"\n"
+ " ],\n"
+ " \"rows\": [\n"
+ " [ 10, 256, 300, 2, 3 ],\n"
+ " [ 20, 16, 10, 3, 0 ],\n"
+ " [ 30, 256, 0, 0, 0 ],\n"
+ " [ 40, 16, 4, 4, 0 ],\n"
+ " [ 50, 256, 2, 1, 1 ]\n"
+ " ],\n"
+ " \"timestamp\": \"2018-05-04 15:03:37.000000\" }\n"
+ "}\n"
+ },
+ {
+ "Single-Subnet",
+ "{\n"
+ " \"command\": \"stat-lease4-get\",\n"
+ " \"arguments\": {"
+ " \"subnet-id\": 20"
+ " }\n"
+ "}",
+ "stat-lease4-get[subnet-id=20]: 1 rows found",
+ "{\n"
+ "\"result-set\": {\n"
+ " \"columns\": [\n"
+ " \"subnet-id\", \"total-addresses\",\n"
+ " \"cumulative-assigned-addresses\",\n"
+ " \"assigned-addresses\", \"declined-addresses\"\n"
+ " ],\n"
+ " \"rows\": [\n"
+ " [ 20, 16, 10, 3, 0 ]\n"
+ " ],\n"
+ " \"timestamp\": \"2018-05-04 15:03:37.000000\" }\n"
+ "}\n"
+ },
+ {
+ "Subnet-Range: beginning to middle",
+ "{\n"
+ " \"command\": \"stat-lease4-get\",\n"
+ " \"arguments\": {"
+ " \"subnet-range\": {\n"
+ " \"first-subnet-id\": 10,"
+ " \"last-subnet-id\": 30"
+ " }\n"
+ " }\n"
+ "}",
+ "stat-lease4-get[subnets 10 through 30]: 3 rows found",
+ "{\n"
+ "\"result-set\": {\n"
+ " \"columns\": [\n"
+ " \"subnet-id\", \"total-addresses\",\n"
+ " \"cumulative-assigned-addresses\",\n"
+ " \"assigned-addresses\", \"declined-addresses\"\n"
+ " ],\n"
+ " \"rows\": [\n"
+ " [ 10, 256, 300, 2, 3 ],\n"
+ " [ 20, 16, 10, 3, 0 ],\n"
+ " [ 30, 256, 0, 0, 0 ]\n"
+ " ],\n"
+ " \"timestamp\": \"2018-05-04 15:03:37.000000\" }\n"
+ "}\n"
+ },
+ {
+ "Subnet-Range: all in the middle",
+ "{\n"
+ " \"command\": \"stat-lease4-get\",\n"
+ " \"arguments\": {"
+ " \"subnet-range\": {\n"
+ " \"first-subnet-id\": 20,"
+ " \"last-subnet-id\": 40"
+ " }\n"
+ " }\n"
+ "}",
+ "stat-lease4-get[subnets 20 through 40]: 3 rows found",
+ "{\n"
+ "\"result-set\": {\n"
+ " \"columns\": [\n"
+ " \"subnet-id\", \"total-addresses\",\n"
+ " \"cumulative-assigned-addresses\",\n"
+ " \"assigned-addresses\", \"declined-addresses\"\n"
+ " ],\n"
+ " \"rows\": [\n"
+ " [ 20, 16, 10, 3, 0 ],\n"
+ " [ 30, 256, 0, 0, 0 ],\n"
+ " [ 40, 16, 4, 4, 0 ]\n"
+ " ],\n"
+ " \"timestamp\": \"2018-05-04 15:03:37.000000\" }\n"
+ "}\n"
+ },
+ {
+ "Subnet-Range: middle to end",
+ "{\n"
+ " \"command\": \"stat-lease4-get\",\n"
+ " \"arguments\": {"
+ " \"subnet-range\": {\n"
+ " \"first-subnet-id\": 30,"
+ " \"last-subnet-id\": 50"
+ " }\n"
+ " }\n"
+ "}",
+ "stat-lease4-get[subnets 30 through 50]: 3 rows found",
+ "{\n"
+ "\"result-set\": {\n"
+ " \"columns\": [\n"
+ " \"subnet-id\", \"total-addresses\",\n"
+ " \"cumulative-assigned-addresses\",\n"
+ " \"assigned-addresses\", \"declined-addresses\"\n"
+ " ],\n"
+ " \"rows\": [\n"
+ " [ 30, 256, 0, 0, 0 ],\n"
+ " [ 40, 16, 4, 4, 0 ],\n"
+ " [ 50, 256, 2, 1, 1 ]\n"
+ " ],\n"
+ " \"timestamp\": \"2018-05-04 15:03:37.000000\" }\n"
+ "}\n"
+ },
+ {
+ "Subnet-Range: fuzzy range",
+ "{\n"
+ " \"command\": \"stat-lease4-get\",\n"
+ " \"arguments\": {"
+ " \"subnet-range\": {\n"
+ " \"first-subnet-id\": 25,"
+ " \"last-subnet-id\": 45"
+ " }\n"
+ " }\n"
+ "}",
+ "stat-lease4-get[subnets 25 through 45]: 2 rows found",
+ "{\n"
+ "\"result-set\": {\n"
+ " \"columns\": [\n"
+ " \"subnet-id\", \"total-addresses\",\n"
+ " \"cumulative-assigned-addresses\",\n"
+ " \"assigned-addresses\", \"declined-addresses\"\n"
+ " ],\n"
+ " \"rows\": [\n"
+ " [ 30, 256, 0, 0, 0 ],\n"
+ " [ 40, 16, 4, 4, 0 ]\n"
+ " ],\n"
+ " \"timestamp\": \"2018-05-04 15:03:37.000000\" }\n"
+ "}\n"
+ }
+ };
+
+ for (auto test = tests.begin(); test != tests.end(); ++test) {
+ {
+ SCOPED_TRACE((*test).description_);
+ testCommand((*test).command_txt_, CONTROL_RESULT_SUCCESS,
+ (*test).exp_response_, (*test).exp_result_json);
+ }
+ }
+
+}
+
+// Verifies result content for valid v4 statistic commands that
+// result in no matching subnets.
+TEST_F(StatCmdsTest, statLease4GetSubnetsNotFound) {
+ setFamily(AF_INET);
+
+ // Initialize lease manager.
+ initLeaseMgr4();
+
+ // Note timestamp actual values are not important but are included
+ // for clarity.
+ std::vector<TestScenario> tests = {
+ {
+ "Single-Subnet, undefined subnet",
+ "{\n"
+ " \"command\": \"stat-lease4-get\",\n"
+ " \"arguments\": {"
+ " \"subnet-id\": 88"
+ " }\n"
+ "}",
+ "stat-lease4-get[subnet-id=88]: no matching data, subnet-id: 88 does not exist",
+ "{}"
+ },
+ {
+ "Subnet-Range: empty range below",
+ "{\n"
+ " \"command\": \"stat-lease4-get\",\n"
+ " \"arguments\": {"
+ " \"subnet-range\": {\n"
+ " \"first-subnet-id\": 2,"
+ " \"last-subnet-id\": 6"
+ " }\n"
+ " }\n"
+ "}",
+ "stat-lease4-get[subnets 2 through 6]: no matching data, selected ID range: 2 through 6 includes no known subnets",
+ "{}"
+ },
+ {
+ "Subnet-Range: empty range above",
+ "{\n"
+ " \"command\": \"stat-lease4-get\",\n"
+ " \"arguments\": {"
+ " \"subnet-range\": {\n"
+ " \"first-subnet-id\": 200,"
+ " \"last-subnet-id\": 600"
+ " }\n"
+ " }\n"
+ "}",
+ "stat-lease4-get[subnets 200 through 600]: no matching data, selected ID range: 200 through 600 includes no known subnets",
+ "{}"
+ }
+ };
+
+ for (auto test = tests.begin(); test != tests.end(); ++test) {
+ {
+ SCOPED_TRACE((*test).description_);
+ testCommand((*test).command_txt_, CONTROL_RESULT_EMPTY,
+ (*test).exp_response_, (*test).exp_result_json);
+ }
+ }
+
+}
+
+// Verifies detection of invalid v6 input parameters.
+TEST_F(StatCmdsTest, StatLease6GetBadParams) {
+ setFamily(AF_INET6);
+
+ // Initialize lease manager
+ initLeaseMgr6();
+
+ std::vector<TestScenario> tests = {
+ {
+ "arguments not a map",
+ "{\n"
+ " \"command\": \"stat-lease6-get\",\n"
+ " \"arguments\": \"not a map\"\n"
+ "}",
+ "'arguments' parameter is not a map"
+ },
+ {
+ "subnet-id 0",
+ "{\n"
+ " \"command\": \"stat-lease6-get\",\n"
+ " \"arguments\": {"
+ " \"subnet-id\": 0\n"
+ " }\n"
+ "}",
+ "'subnet-id' parameter must be > 0"
+ },
+
+ {
+ "subnet-id -1",
+ "{\n"
+ " \"command\": \"stat-lease6-get\",\n"
+ " \"arguments\": {"
+ " \"subnet-id\": -1\n"
+ " }\n"
+ "}",
+ "'subnet-id' parameter must be > 0"
+ },
+ {
+ "subnet-id string",
+ "{\n"
+ " \"command\": \"stat-lease6-get\",\n"
+ " \"arguments\": {"
+ " \"subnet-id\": \"boo\"\n"
+ " }\n"
+ "}",
+ "'subnet-id' parameter is not integer"
+ },
+ {
+ "subnet-range not a map",
+ "{\n"
+ " \"command\": \"stat-lease6-get\",\n"
+ " \"arguments\": {"
+ " \"subnet-range\": -1\n"
+ " }\n"
+ "}",
+ "subnet-range parameter is not a map"
+ },
+ {
+ "subnet-range empty",
+ "{\n"
+ " \"command\": \"stat-lease6-get\",\n"
+ " \"arguments\": {"
+ " \"subnet-range\": {\n"
+ " }\n"
+ " }\n"
+ "}",
+ "'first-subnet-id' parameter missing or not an integer"
+ },
+ {
+ "first-subnet-id string",
+ "{\n"
+ " \"command\": \"stat-lease6-get\",\n"
+ " \"arguments\": {"
+ " \"subnet-range\": {\n"
+ " \"first-subnet-id\": \"boo\"\n"
+ " }\n"
+ " }\n"
+ "}",
+ "'first-subnet-id' parameter missing or not an integer"
+ },
+ {
+ "first-subnet-id < 0",
+ "{\n"
+ " \"command\": \"stat-lease6-get\",\n"
+ " \"arguments\": {"
+ " \"subnet-range\": {\n"
+ " \"first-subnet-id\": -77\n"
+ " }\n"
+ " }\n"
+ "}",
+ "'first-subnet-id' parameter must be > 0"
+ },
+ {
+ "last-subnet-id missing",
+ "{\n"
+ " \"command\": \"stat-lease6-get\",\n"
+ " \"arguments\": {"
+ " \"subnet-range\": {\n"
+ " \"first-subnet-id\": 10\n"
+ " }\n"
+ " }\n"
+ "}",
+ "'last-subnet-id' parameter missing or not an integer"
+ },
+ {
+ "last-subnet-id string",
+ "{\n"
+ " \"command\": \"stat-lease6-get\",\n"
+ " \"arguments\": {"
+ " \"subnet-range\": {\n"
+ " \"first-subnet-id\": 10,\n"
+ " \"last-subnet-id\": \"boo\"\n"
+ " }\n"
+ " }\n"
+ "}",
+ "'last-subnet-id' parameter missing or not an integer"
+ },
+ {
+ "last-subnet-id < 0",
+ "{\n"
+ " \"command\": \"stat-lease6-get\",\n"
+ " \"arguments\": {"
+ " \"subnet-range\": {\n"
+ " \"first-subnet-id\": 10,\n"
+ " \"last-subnet-id\": -1\n"
+ " }\n"
+ " }\n"
+ "}",
+ "'last-subnet-id' parameter must be > 0"
+ },
+ {
+ "invalid range",
+ "{\n"
+ " \"command\": \"stat-lease6-get\",\n"
+ " \"arguments\": {"
+ " \"subnet-range\": {\n"
+ " \"first-subnet-id\": 50,\n"
+ " \"last-subnet-id\": 2\n"
+ " }\n"
+ " }\n"
+ "}",
+ "'last-subnet-id' must be greater than 'first-subnet-id'"
+ },
+ {
+ "both subnet and range",
+ "{\n"
+ " \"command\": \"stat-lease6-get\",\n"
+ " \"arguments\": {"
+ " \"subnet-id\": 10,\n"
+ " \"subnet-range\": {\n"
+ " \"first-subnet-id\": 20,"
+ " \"last-subnet-id\": 40"
+ " }\n"
+ " }\n"
+ "}",
+ "cannot specify both subnet-id and subnet-range"
+ }
+ };
+
+ for (auto test = tests.begin(); test != tests.end(); ++test) {
+ {
+ SCOPED_TRACE((*test).description_);
+ testCommand((*test).command_txt_, CONTROL_RESULT_ERROR,(*test).exp_response_);
+ }
+ }
+}
+
+// Verifies result content for valid v6 statistic commands.
+// These test scenarios are all valid, and not expected to throw.
+TEST_F(StatCmdsTest, statLease6GetValid) {
+ setFamily(AF_INET6);
+
+ // Initialize lease manager
+ initLeaseMgr6();
+
+ // Note timestamp actual values are not important but are included
+ // for clarity.
+ std::vector<TestScenario> tests = {
+ {
+ "ALL-Subnets6",
+ "{\n"
+ " \"command\": \"stat-lease6-get\",\n"
+ " \"arguments\": {"
+ " }\n"
+ "}",
+ "stat-lease6-get[all subnets]: 5 rows found",
+ "{\n"
+ "\"result-set\": {\n"
+ " \"columns\": [\n"
+ " \"subnet-id\", \"total-nas\",\n"
+ " \"cumulative-assigned-nas\", \"assigned-nas\",\n"
+ " \"declined-addresses\", \"total-pds\",\n"
+ " \"cumulative-assigned-pds\", \"assigned-pds\"\n"
+ " ],\n"
+ " \"rows\": [\n"
+ " [ 10, 65536, 10000, 2, 3, 0, 0, 0 ],\n"
+ " [ 20, 16777216, 10, 3, 0, 0, 0, 0 ],\n"
+ " [ 30, 16, 2, 1, 1, 65536, 4, 3 ],\n"
+ " [ 40, 16777216, 0, 0, 0, 0, 0, 0 ],\n"
+ " [ 50, 0, 0, 0, 0, 65536, 1000, 2 ]\n"
+ " ],\n"
+ " \"timestamp\": \"2018-05-04 15:03:37.000000\" }\n"
+ "}\n"
+ },
+ {
+ "ALL-Subnets6 arguments omitted",
+ "{\n"
+ " \"command\": \"stat-lease6-get\"\n"
+ "}",
+ "stat-lease6-get[all subnets]: 5 rows found",
+ "{\n"
+ "\"result-set\": {\n"
+ " \"columns\": [\n"
+ " \"subnet-id\", \"total-nas\",\n"
+ " \"cumulative-assigned-nas\", \"assigned-nas\",\n"
+ " \"declined-addresses\", \"total-pds\",\n"
+ " \"cumulative-assigned-pds\", \"assigned-pds\"\n"
+ " ],\n"
+ " \"rows\": [\n"
+ " [ 10, 65536, 10000, 2, 3, 0, 0, 0 ],\n"
+ " [ 20, 16777216, 10, 3, 0, 0, 0, 0 ],\n"
+ " [ 30, 16, 2, 1, 1, 65536, 4, 3 ],\n"
+ " [ 40, 16777216, 0, 0, 0, 0, 0, 0 ],\n"
+ " [ 50, 0, 0, 0, 0, 65536, 1000, 2 ]\n"
+ " ],\n"
+ " \"timestamp\": \"2018-05-04 15:03:37.000000\" }\n"
+ "}\n"
+ },
+ {
+ "Single-Subnet6",
+ "{\n"
+ " \"command\": \"stat-lease6-get\",\n"
+ " \"arguments\": {"
+ " \"subnet-id\": 20"
+ " }\n"
+ "}",
+ "stat-lease6-get[subnet-id=20]: 1 rows found",
+ "{\n"
+ "\"result-set\": {\n"
+ " \"columns\": [\n"
+ " \"subnet-id\", \"total-nas\",\n"
+ " \"cumulative-assigned-nas\", \"assigned-nas\",\n"
+ " \"declined-addresses\", \"total-pds\",\n"
+ " \"cumulative-assigned-pds\", \"assigned-pds\"\n"
+ " ],\n"
+ " \"rows\": [\n"
+ " [ 20, 16777216, 10, 3, 0, 0, 0, 0 ]\n"
+ " ],\n"
+ " \"timestamp\": \"2018-05-04 15:03:37.000000\" }\n"
+ "}\n"
+ },
+ {
+ "Subnet-Range6: beginning to middle",
+ "{\n"
+ " \"command\": \"stat-lease6-get\",\n"
+ " \"arguments\": {"
+ " \"subnet-range\": {\n"
+ " \"first-subnet-id\": 10,"
+ " \"last-subnet-id\": 30"
+ " }\n"
+ " }\n"
+ "}",
+ "stat-lease6-get[subnets 10 through 30]: 3 rows found",
+ "{\n"
+ "\"result-set\": {\n"
+ " \"columns\": [\n"
+ " \"subnet-id\", \"total-nas\",\n"
+ " \"cumulative-assigned-nas\", \"assigned-nas\",\n"
+ " \"declined-addresses\", \"total-pds\",\n"
+ " \"cumulative-assigned-pds\", \"assigned-pds\"\n"
+ " ],\n"
+ " \"rows\": [\n"
+ " [ 10, 65536, 10000, 2, 3, 0, 0, 0 ],\n"
+ " [ 20, 16777216, 10, 3, 0, 0, 0, 0 ],\n"
+ " [ 30, 16, 2, 1, 1, 65536, 4, 3 ]\n"
+ " ],\n"
+ " \"timestamp\": \"2018-05-04 15:03:37.000000\" }\n"
+ "}\n"
+ },
+ {
+ "Subnet-Range6: all in the middle",
+ "{\n"
+ " \"command\": \"stat-lease6-get\",\n"
+ " \"arguments\": {"
+ " \"subnet-range\": {\n"
+ " \"first-subnet-id\": 20,"
+ " \"last-subnet-id\": 40"
+ " }\n"
+ " }\n"
+ "}",
+ "stat-lease6-get[subnets 20 through 40]: 3 rows found",
+ "{\n"
+ "\"result-set\": {\n"
+ " \"columns\": [\n"
+ " \"subnet-id\", \"total-nas\",\n"
+ " \"cumulative-assigned-nas\", \"assigned-nas\",\n"
+ " \"declined-addresses\", \"total-pds\",\n"
+ " \"cumulative-assigned-pds\", \"assigned-pds\"\n"
+ " ],\n"
+ " \"rows\": [\n"
+ " [ 20, 16777216, 10, 3, 0, 0, 0, 0 ],\n"
+ " [ 30, 16, 2, 1, 1, 65536, 4, 3 ],\n"
+ " [ 40, 16777216, 0, 0, 0, 0, 0, 0 ]\n"
+ " ],\n"
+ " \"timestamp\": \"2018-05-04 15:03:37.000000\" }\n"
+ "}\n"
+ },
+ {
+ "Subnet-Range6: middle to end",
+ "{\n"
+ " \"command\": \"stat-lease6-get\",\n"
+ " \"arguments\": {"
+ " \"subnet-range\": {\n"
+ " \"first-subnet-id\": 30,"
+ " \"last-subnet-id\": 50"
+ " }\n"
+ " }\n"
+ "}",
+ "stat-lease6-get[subnets 30 through 50]: 3 rows found",
+ "{\n"
+ "\"result-set\": {\n"
+ " \"columns\": [\n"
+ " \"subnet-id\", \"total-nas\",\n"
+ " \"cumulative-assigned-nas\", \"assigned-nas\",\n"
+ " \"declined-addresses\", \"total-pds\",\n"
+ " \"cumulative-assigned-pds\", \"assigned-pds\"\n"
+ " ],\n"
+ " \"rows\": [\n"
+ " [ 30, 16, 2, 1, 1, 65536, 4, 3 ],\n"
+ " [ 40, 16777216, 0, 0, 0, 0, 0, 0 ],\n"
+ " [ 50, 0, 0, 0, 0, 65536, 1000, 2 ]\n"
+ " ],\n"
+ " \"timestamp\": \"2018-05-04 15:03:37.000000\" }\n"
+ "}\n"
+ },
+ {
+ "Subnet-Range6: fuzzy range",
+ "{\n"
+ " \"command\": \"stat-lease6-get\",\n"
+ " \"arguments\": {"
+ " \"subnet-range\": {\n"
+ " \"first-subnet-id\": 25,"
+ " \"last-subnet-id\": 45"
+ " }\n"
+ " }\n"
+ "}",
+ "stat-lease6-get[subnets 25 through 45]: 2 rows found",
+ "{\n"
+ "\"result-set\": {\n"
+ " \"columns\": [\n"
+ " \"subnet-id\", \"total-nas\",\n"
+ " \"cumulative-assigned-nas\", \"assigned-nas\",\n"
+ " \"declined-addresses\", \"total-pds\",\n"
+ " \"cumulative-assigned-pds\", \"assigned-pds\"\n"
+ " ],\n"
+ " \"rows\": [\n"
+ " [ 30, 16, 2, 1, 1, 65536, 4, 3 ],\n"
+ " [ 40, 16777216, 0, 0, 0, 0, 0, 0 ]\n"
+ " ],\n"
+ " \"timestamp\": \"2018-05-04 15:03:37.000000\" }\n"
+ "}\n"
+ }
+ };
+
+ for (auto test = tests.begin(); test != tests.end(); ++test) {
+ {
+ SCOPED_TRACE((*test).description_);
+ testCommand((*test).command_txt_, CONTROL_RESULT_SUCCESS,
+ (*test).exp_response_, (*test).exp_result_json);
+ }
+ }
+
+}
+
+// Verifies result content for valid v6 statistic commands that
+// result in no matching subnets.
+TEST_F(StatCmdsTest, statLease6GetSubnetsNotFound) {
+ setFamily(AF_INET6);
+
+ // Initialize lease manager
+ initLeaseMgr6();
+
+ // Note timestamp actual values are not important but are included
+ // for clarity.
+ std::vector<TestScenario> tests = {
+ {
+ "Single-Subnet6, undefined subnet",
+ "{\n"
+ " \"command\": \"stat-lease6-get\",\n"
+ " \"arguments\": {"
+ " \"subnet-id\": 88"
+ " }\n"
+ "}",
+ "stat-lease6-get[subnet-id=88]: no matching data, subnet-id: 88 does not exist",
+ "{}"
+ },
+ {
+ "Subnet-Range6: empty range below",
+ "{\n"
+ " \"command\": \"stat-lease6-get\",\n"
+ " \"arguments\": {"
+ " \"subnet-range\": {\n"
+ " \"first-subnet-id\": 2,"
+ " \"last-subnet-id\": 6"
+ " }\n"
+ " }\n"
+ "}",
+ "stat-lease6-get[subnets 2 through 6]: no matching data, selected ID range: 2 through 6 includes no known subnets",
+ "{}"
+ },
+ {
+ "Subnet-Range6: empty range above",
+ "{\n"
+ " \"command\": \"stat-lease6-get\",\n"
+ " \"arguments\": {"
+ " \"subnet-range\": {\n"
+ " \"first-subnet-id\": 200,"
+ " \"last-subnet-id\": 600"
+ " }\n"
+ " }\n"
+ "}",
+ "stat-lease6-get[subnets 200 through 600]: no matching data, selected ID range: 200 through 600 includes no known subnets",
+ "{}"
+ }
+ };
+
+ for (auto test = tests.begin(); test != tests.end(); ++test) {
+ {
+ SCOPED_TRACE((*test).description_);
+ testCommand((*test).command_txt_, CONTROL_RESULT_EMPTY,
+ (*test).exp_response_, (*test).exp_result_json);
+ }
+ }
+}
+
+// Verifies that statistics for v4 subnets which no longer
+// exist are dropped from the result sets.
+TEST_F(StatCmdsTest, statLease4OrphanedStats) {
+ setFamily(AF_INET);
+
+ // Initialize lease manager.
+ initLeaseMgr4();
+
+ // Now remove subnets 10, 30, and 50 thereby orphaning their leases.
+ CfgMgr& cfg_mgr = CfgMgr::instance();
+ CfgSubnets4Ptr subnets = cfg_mgr.getCurrentCfg()->getCfgSubnets4();
+ ASSERT_NO_THROW_LOG(subnets->del(10));
+ ASSERT_NO_THROW_LOG(subnets->del(30));
+ ASSERT_NO_THROW_LOG(subnets->del(50));
+ cfg_mgr.commit();
+
+ // Note timestamp actual values are not important but are included
+ // for clarity.
+ std::vector<TestScenario> tests = {
+ {
+ "ALL-Subnets",
+ "{\n"
+ " \"command\": \"stat-lease4-get\",\n"
+ " \"arguments\": {"
+ " }\n"
+ "}",
+ "stat-lease4-get[all subnets]: 2 rows found",
+ "{\n"
+ "\"result-set\": {\n"
+ " \"columns\": [\n"
+ " \"subnet-id\", \"total-addresses\",\n"
+ " \"cumulative-assigned-addresses\",\n"
+ " \"assigned-addresses\", \"declined-addresses\"\n"
+ " ],\n"
+ " \"rows\": [\n"
+ " [ 20, 16, 0, 3, 0 ],\n"
+ " [ 40, 16, 0, 4, 0 ]\n"
+ " ],\n"
+ " \"timestamp\": \"2018-05-04 15:03:37.000000\" }\n"
+ "}\n"
+ }
+ };
+
+ for (auto test = tests.begin(); test != tests.end(); ++test) {
+ {
+ SCOPED_TRACE((*test).description_);
+ testCommand((*test).command_txt_, CONTROL_RESULT_SUCCESS,
+ (*test).exp_response_, (*test).exp_result_json);
+ }
+ }
+}
+
+// Verifies that statistics for v6 subnets which no longer
+// exist are dropped from the result sets.
+TEST_F(StatCmdsTest, statLease6OrphanedStats) {
+ setFamily(AF_INET6);
+
+ // Initialize lease manager.
+ initLeaseMgr6();
+
+ // Now remove subnets 10, 30, and 50 thereby orphaning their leases.
+ CfgMgr& cfg_mgr = CfgMgr::instance();
+ CfgSubnets6Ptr subnets = cfg_mgr.getCurrentCfg()->getCfgSubnets6();
+ ASSERT_NO_THROW_LOG(subnets->del(10));
+ ASSERT_NO_THROW_LOG(subnets->del(30));
+ ASSERT_NO_THROW_LOG(subnets->del(50));
+ cfg_mgr.commit();
+
+ // Note timestamp actual values are not important but are included
+ // for clarity.
+ std::vector<TestScenario> tests = {
+ {
+ "ALL-Subnets",
+ "{\n"
+ " \"command\": \"stat-lease6-get\",\n"
+ " \"arguments\": {"
+ " }\n"
+ "}",
+ "stat-lease6-get[all subnets]: 2 rows found",
+ "{\n"
+ "\"result-set\": {\n"
+ " \"columns\": [\n"
+ " \"subnet-id\", \"total-nas\",\n"
+ " \"cumulative-assigned-nas\", \"assigned-nas\",\n"
+ " \"declined-addresses\", \"total-pds\",\n"
+ " \"cumulative-assigned-pds\", \"assigned-pds\"\n"
+ " ],\n"
+ " \"rows\": [\n"
+ " [ 20, 16777216, 0, 3, 0, 0, 0, 0 ],\n"
+ " [ 40, 16777216, 0, 0, 0, 0, 0, 0 ]\n"
+ " ],\n"
+ " \"timestamp\": \"2018-05-04 15:03:37.000000\" }\n"
+ "}\n"
+ }
+ };
+
+ for (auto test = tests.begin(); test != tests.end(); ++test) {
+ {
+ SCOPED_TRACE((*test).description_);
+ testCommand((*test).command_txt_, CONTROL_RESULT_SUCCESS,
+ (*test).exp_response_, (*test).exp_result_json);
+ }
+ }
+}
+
+} // end of anonymous namespace
diff --git a/src/hooks/dhcp/stat_cmds/version.cc b/src/hooks/dhcp/stat_cmds/version.cc
new file mode 100644
index 0000000..32834ce
--- /dev/null
+++ b/src/hooks/dhcp/stat_cmds/version.cc
@@ -0,0 +1,17 @@
+// Copyright (C) 2018 Internet Systems Consortium, Inc. ("ISC")
+//
+// This Source Code Form is subject to the terms of the Mozilla Public
+// License, v. 2.0. If a copy of the MPL was not distributed with this
+// file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+#include <config.h>
+#include <hooks/hooks.h>
+
+extern "C" {
+
+/// @brief returns Kea hooks version.
+int version() {
+ return (KEA_HOOKS_VERSION);
+}
+
+}