2
0
mirror of https://gitlab.isc.org/isc-projects/kea synced 2025-08-31 05:55:28 +00:00

[#1950] Addressed comments

This commit is contained in:
Francis Dupont
2021-07-15 13:08:33 +02:00
parent 3ac82c0c8a
commit ce6724427c
4 changed files with 17 additions and 12 deletions

View File

@@ -46,7 +46,7 @@ packet processing, but the exact order depends on the actual processing. Hook po
that are not specific to packet processing (e.g. lease expiration) will be added
to the end of this list.
@subsection d2HooksD2SrvConfigured dhcp2_srv_configured
@subsection d2HooksD2SrvConfigured d2_srv_configured
- @b Arguments:
- name: @b io_context, type: isc::asiolink::IOServicePtr, direction: <b>in</b>
- name: @b json_config, type: isc::data::ConstElementPtr, direction: <b>in</b>

View File

@@ -111,14 +111,14 @@ libcallout_la_LDFLAGS = -avoid-version -export-dynamic -module -rpath /nowhere
# The d2_srv_configured callout library
libconfigured_la_SOURCES = configured_library.cc
libconfigured_la_CXXFLAGS = $(AM_CXXFLAGS)
libconfigured_la_CPPFLAGS = $(AM_CPPFLAGS)
libconfigured_la_CPPFLAGS = $(AM_CPPFLAGS) $(GTEST_INCLUDES)
libconfigured_la_LIBADD = $(top_builddir)/src/lib/hooks/libkea-hooks.la
libconfigured_la_LIBADD += $(top_builddir)/src/lib/cc/libkea-cc.la
libconfigured_la_LIBADD += $(top_builddir)/src/lib/asiolink/libkea-asiolink.la
libconfigured_la_LIBADD += $(top_builddir)/src/lib/log/libkea-log.la
libconfigured_la_LIBADD += $(top_builddir)/src/lib/util/libkea-util.la
libconfigured_la_LIBADD += $(top_builddir)/src/lib/exceptions/libkea-exceptions.la
libconfigured_la_LIBADD += $(LOG4CPLUS_LIBS) $(BOOST_LIBS)
libconfigured_la_LIBADD += $(LOG4CPLUS_LIBS) $(BOOST_LIBS) $(GTEST_LDADD)
libconfigured_la_LDFLAGS = -avoid-version -export-dynamic -module -rpath /nowhere
noinst_LTLIBRARIES = libcallout.la libconfigured.la

View File

@@ -9,6 +9,7 @@
#include <config.h>
#include <cc/data.h>
#include <hooks/hooks.h>
#include <gtest/gtest.h>
using namespace isc::data;
using namespace isc::hooks;
@@ -22,18 +23,22 @@ extern "C" {
int
d2_srv_configured(CalloutHandle& handle) {
// Get the parameters.
EXPECT_EQ(CalloutHandle::NEXT_STEP_CONTINUE, handle.getStatus());
ConstElementPtr cfg;
string error;
handle.getArgument("json_config", cfg);
EXPECT_TRUE(cfg);
if (!cfg) {
return (1);
}
string error;
handle.getArgument("error", error);
EXPECT_TRUE(error.empty());
if (cfg) {
ConstElementPtr uc = cfg->get("user-context");
if (uc) {
ConstElementPtr msg = uc->get("error");
if (msg && (msg->getType() == Element::string)) {
error = msg->stringValue();
}
ConstElementPtr uc = cfg->get("user-context");
if (uc) {
ConstElementPtr msg = uc->get("error");
if (msg && (msg->getType() == Element::string)) {
error = msg->stringValue();
}
}

View File

@@ -43,7 +43,7 @@ has been invoked.
% DHCP_DDNS_CONFIGURED_CALLOUT_DROP configuration was rejected because a callout set the next step to 'drop': %1
This error message indicates that the DHCP-DDNS had failed configuration
attempt because the next stop of the configured callout was set to 'drop'
attempt because the next step of the configured callout was set to 'drop'
by a hook library. The error message provided by the hook library is displayed.
% DHCP_DDNS_CONFIG_CHECK_FAIL DHCP-DDNS server configuration check failed: %1