Kea 3.2.1-git
gss_tsig_callouts.cc File Reference
#include <config.h>
#include <asiolink/io_service_mgr.h>
#include <gss_tsig_context.h>
#include <gss_tsig_impl.h>
#include <gss_tsig_log.h>
#include <process/daemon.h>
#include <exceptions/exceptions.h>
#include <functional>
#include <sstream>
#include <string>
Include dependency graph for gss_tsig_callouts.cc:

Go to the source code of this file.

Namespaces

namespace  isc
 Defines the logger used by the top-level component of kea-lfc.
namespace  isc::gss_tsig

Functions

int command_processed (CalloutHandle &handle)
 This function is called when a command was processed.
int d2_srv_configured (CalloutHandle &handle)
 This function is called when the server finishes (re)configuration.
int get (CalloutHandle &handle)
 The gss-tsig-get command.
int get_all (CalloutHandle &handle)
 The gss-tsig-get-all command.
int key_del (CalloutHandle &handle)
 The gss-tsig-key-del command.
int key_expire (CalloutHandle &handle)
 The gss-tsig-key-expire command.
int key_get (CalloutHandle &handle)
 The gss-tsig-key-get command.
int lists (CalloutHandle &handle)
 The gss-tsig-list command.
int load (LibraryHandle &handle)
 This function is called when the library is loaded.
int multi_threading_compatible ()
 This function is called to retrieve the multi-threading compatibility.
int purge (CalloutHandle &handle)
 The gss-tsig-purge command.
int purge_all (CalloutHandle &handle)
 The gss-tsig-purge-all command.
int rekey (CalloutHandle &handle)
 The gss-tsig-rekey command.
int rekey_all (CalloutHandle &handle)
 The gss-tsig-rekey-all command.
int select_key (CalloutHandle &handle)
 This function is called when the server selects a DNS server and optionally a TSIG key.
int unload ()
 This function is called when the library is unloaded.

Variables

GssTsigImplPtr isc::gss_tsig::impl
 The GSS-TSIG hook implementation object.

Function Documentation

◆ command_processed()

int command_processed ( CalloutHandle & handle)

This function is called when a command was processed.

Adds an entry to status-get answer.

Parameters
handleCalloutHandle.
Returns
always 0.

Definition at line 285 of file gss_tsig_callouts.cc.

References command_processed(), isc::gss_tsig::GssTsigImpl::commandProcessed(), isc::gss_tsig::GSS_TSIG_COMMAND_PROCESSED_FAILED, isc::gss_tsig::gss_tsig_logger, isc::gss_tsig::impl, and LOG_ERROR.

Referenced by command_processed().

Here is the call graph for this function:

◆ d2_srv_configured()

int d2_srv_configured ( CalloutHandle & handle)

This function is called when the server finishes (re)configuration.

The server reverse map is built and an error is returned when a configuration mismatch is detected.

Parameters
handleCalloutHandle.
Returns
always 0.
Exceptions
Unexpectedwhen something went really wrong.

Definition at line 211 of file gss_tsig_callouts.cc.

References d2_srv_configured(), isc::gss_tsig::GssTsigImpl::finishConfigure(), isc::hooks::CalloutHandle::getArgument(), isc::gss_tsig::GssTsigImpl::getIOService(), isc::hooks::CalloutHandle::getStatus(), isc::gss_tsig::impl, isc::asiolink::IOServiceMgr::instance(), CalloutHandle::NEXT_STEP_CONTINUE, CalloutHandle::NEXT_STEP_DROP, isc::hooks::CalloutHandle::NEXT_STEP_DROP, isc::asiolink::IOServiceMgr::registerIOService(), isc::hooks::CalloutHandle::setArgument(), isc::hooks::CalloutHandle::setStatus(), and isc::gss_tsig::GssTsigImpl::start().

Referenced by d2_srv_configured().

Here is the call graph for this function:

◆ get()

int get ( CalloutHandle & handle)

The gss-tsig-get command.

This command takes an argument id with a string value.

Parameters
handleCalloutHandle.
Returns
always 0.

Definition at line 47 of file gss_tsig_callouts.cc.

References get(), isc::gss_tsig::GssTsigImpl::getHandler(), and isc::gss_tsig::impl.

Referenced by isc::perfdhcp::ExchangeStats::appendSent(), isc::dhcp::Dhcpv4Srv::assignLease(), isc::dhcp::CfgSharedNetworks< SharedNetworkPtrType, SharedNetworkCollection >::del(), isc::dhcp::CfgSharedNetworks< SharedNetworkPtrType, SharedNetworkCollection >::del(), isc::dhcp::OptionSpaceContainer< OptionDefContainer, OptionDefinitionPtr, std::string >::deleteItems(), get(), isc::dhcp::CfgSharedNetworks< SharedNetworkPtrType, SharedNetworkCollection >::getByName(), isc::ha::CommunicationState::getRejectedLeaseUpdatesCountFromContainer(), isc::gss_tsig::GssTsigCfg::getServer(), isc::db::PgSqlConnection::initializeSchema(), load(), isc::perfdhcp::ExchangeStats::matchPackets(), isc::dhcp::CfgSharedNetworks< SharedNetworkPtrType, SharedNetworkCollection >::merge(), isc::perfdhcp::ExchangeStats::printTimestamps(), isc::dhcp::Dhcpv4Srv::processLocalizedQuery4(), isc::lease_query::XidQueue< QueryType >::remove(), isc::dhcp::CfgSubnets4::replace(), isc::dhcp::CfgSubnets6::replace(), isc::dhcp::Dhcpv4Srv::selectSubnet(), isc::dhcp::Dhcpv6Srv::selectSubnet(), isc::dhcp::Dhcpv4Srv::selectSubnet4o6(), and isc::dhcp::CfgSharedNetworks< SharedNetworkPtrType, SharedNetworkCollection >::toElement().

Here is the call graph for this function:

◆ get_all()

int get_all ( CalloutHandle & handle)

The gss-tsig-get-all command.

Parameters
handleCalloutHandle.
Returns
always 0.

Definition at line 56 of file gss_tsig_callouts.cc.

References get_all(), isc::gss_tsig::GssTsigImpl::getAllHandler(), and isc::gss_tsig::impl.

Referenced by get_all(), and load().

Here is the call graph for this function:

◆ key_del()

int key_del ( CalloutHandle & handle)

The gss-tsig-key-del command.

This command takes an argument name with a string value.

Parameters
handleCalloutHandle.
Returns
always 0.

Definition at line 98 of file gss_tsig_callouts.cc.

References isc::gss_tsig::impl, key_del(), and isc::gss_tsig::GssTsigImpl::keyDelHandler().

Referenced by key_del(), and load().

Here is the call graph for this function:

◆ key_expire()

int key_expire ( CalloutHandle & handle)

The gss-tsig-key-expire command.

This command takes an argument name with a string value.

Parameters
handleCalloutHandle.
Returns
always 0.

Definition at line 87 of file gss_tsig_callouts.cc.

References isc::gss_tsig::impl, key_expire(), and isc::gss_tsig::GssTsigImpl::keyExpireHandler().

Referenced by key_expire(), and load().

Here is the call graph for this function:

◆ key_get()

int key_get ( CalloutHandle & handle)

The gss-tsig-key-get command.

This command takes an argument name with a string value.

Parameters
handleCalloutHandle.
Returns
always 0.

Definition at line 76 of file gss_tsig_callouts.cc.

References isc::gss_tsig::impl, key_get(), and isc::gss_tsig::GssTsigImpl::keyGetHandler().

Referenced by key_get(), and load().

Here is the call graph for this function:

◆ lists()

int lists ( CalloutHandle & handle)

The gss-tsig-list command.

Parameters
handleCalloutHandle.
Returns
always 0.

Definition at line 65 of file gss_tsig_callouts.cc.

References isc::gss_tsig::impl, isc::gss_tsig::GssTsigImpl::listHandler(), and lists().

Referenced by lists(), and load().

Here is the call graph for this function:

◆ load()

int load ( LibraryHandle & handle)

This function is called when the library is loaded.

Returns
always 0.

Definition at line 146 of file gss_tsig_callouts.cc.

References isc::gss_tsig::GssTsigImpl::GssTsigImpl(), isc::gss_tsig::GssTsigImpl::configure(), get(), get_all(), isc::hooks::LibraryHandle::getParameters(), isc::process::Daemon::getProcName(), isc::gss_tsig::GSS_TSIG_LOAD_FAILED, isc::gss_tsig::GSS_TSIG_LOAD_OK, isc::gss_tsig::gss_tsig_logger, isc::gss_tsig::impl, isc_throw, key_del(), key_expire(), key_get(), lists(), load(), LOG_ERROR, LOG_INFO, purge(), purge_all(), isc::hooks::LibraryHandle::registerCommandCallout(), rekey(), and rekey_all().

Referenced by load(), and load().

Here is the call graph for this function:

◆ multi_threading_compatible()

int multi_threading_compatible ( )

This function is called to retrieve the multi-threading compatibility.

Returns
1 which means compatible with multi-threading.

Definition at line 199 of file gss_tsig_callouts.cc.

References multi_threading_compatible().

Referenced by multi_threading_compatible().

Here is the call graph for this function:

◆ purge()

int purge ( CalloutHandle & handle)

The gss-tsig-purge command.

This command takes an argument id with a string value.

Parameters
handleCalloutHandle.
Returns
always 0.

Definition at line 109 of file gss_tsig_callouts.cc.

References isc::gss_tsig::impl, purge(), and isc::gss_tsig::GssTsigImpl::purgeHandler().

Referenced by load(), and purge().

Here is the call graph for this function:

◆ purge_all()

int purge_all ( CalloutHandle & handle)

The gss-tsig-purge-all command.

Parameters
handleCalloutHandle.
Returns
always 0.

Definition at line 118 of file gss_tsig_callouts.cc.

References isc::gss_tsig::impl, purge_all(), and isc::gss_tsig::GssTsigImpl::purgeAllHandler().

Referenced by load(), and purge_all().

Here is the call graph for this function:

◆ rekey()

int rekey ( CalloutHandle & handle)

The gss-tsig-rekey command.

This command takes an argument id with a string value.

Parameters
handleCalloutHandle.
Returns
always 0.

Definition at line 129 of file gss_tsig_callouts.cc.

References isc::gss_tsig::impl, rekey(), and isc::gss_tsig::GssTsigImpl::rekeyHandler().

Referenced by load(), isc::gss_tsig::GssTsigImpl::processAllServersKeys(), isc::gss_tsig::GssTsigImpl::processServerKeys(), and rekey().

Here is the call graph for this function:

◆ rekey_all()

int rekey_all ( CalloutHandle & handle)

The gss-tsig-rekey-all command.

Parameters
handleCalloutHandle.
Returns
always 0.

Definition at line 138 of file gss_tsig_callouts.cc.

References isc::gss_tsig::impl, rekey_all(), and isc::gss_tsig::GssTsigImpl::rekeyAllHandler().

Referenced by load(), and rekey_all().

Here is the call graph for this function:

◆ select_key()

int select_key ( CalloutHandle & handle)

This function is called when the server selects a DNS server and optionally a TSIG key.

An usable GSS-TSIG key for the DNS server is looked for:

  • if GSS-TSIG is not enabled: just return with CONTINUE
  • if a key was found: overwrite the selected key with it and return with CONTINUE
  • if no key was found but GSS-TSIG is enabled: return with SKIP (i.e. implement this as GSS-TSIG is required)
Parameters
handleCalloutHandle.
Returns
always 0.

Definition at line 252 of file gss_tsig_callouts.cc.

References isc::gss_tsig::GssTsigImpl::findKey(), isc::hooks::CalloutHandle::getArgument(), isc::hooks::CalloutHandle::getStatus(), isc::gss_tsig::impl, CalloutHandle::NEXT_STEP_CONTINUE, CalloutHandle::NEXT_STEP_SKIP, select_key(), isc::hooks::CalloutHandle::setArgument(), and isc::hooks::CalloutHandle::setStatus().

Referenced by select_key().

Here is the call graph for this function:

◆ unload()

int unload ( )

This function is called when the library is unloaded.

Returns
always 0.

Definition at line 186 of file gss_tsig_callouts.cc.

References isc::gss_tsig::GssTsigImpl::getIOService(), isc::gss_tsig::gss_tsig_logger, isc::gss_tsig::GSS_TSIG_UNLOAD_OK, isc::gss_tsig::impl, isc::asiolink::IOServiceMgr::instance(), LOG_INFO, isc::gss_tsig::GssTsigImpl::stop(), unload(), and isc::asiolink::IOServiceMgr::unregisterIOService().

Referenced by unload().

Here is the call graph for this function: