21#include <boost/algorithm/string/split.hpp>
22#include <boost/algorithm/string/classification.hpp>
171 template<
typename CfgSubnetPtrType>
173 size_t err_count = 0;
175 auto const& subnets = cfg_subnets->getAll();
176 for (
auto const& subnet : *subnets) {
179 }
catch (
const std::exception& ex) {
182 .arg(subnet->toText()).arg(ex.what());
void configure(isc::data::ConstElementPtr params)
Configure the Ddns Tuning implementation.
dhcp::ExpressionPtr fetchScopedHostnameExpression(dhcp::ConstSubnetPtr subnet)
Fetches the expression that is in scope for the given subnet.
void flushCache(bool preserve_global=true)
Flushes the cache contents.
uint16_t getFamily()
Returns the protocol family of the address list.
DdnsTuningImpl(uint16_t family=AF_INET)
Constructor.
~DdnsTuningImpl()
Destructor.
ExpressionCache subnet_exprs_
Per subnet expression cache.
dhcp::ExpressionPtr getHostnameExpression(const dhcp::SubnetID &subnet_id)
Fetches the hostname for a given subnet_id.
void setHostnameExpression(const dhcp::SubnetID &subnet_id, dhcp::ExpressionPtr &expression)
Set the hostname expression for a given subnet.
dhcp::ExpressionPtr parseExpression(const std::string &expression_str) const
Parses an expression string into an Expression.
boost::posix_time::ptime getLastFlushTime()
Fetches the time (in seconds) of when the cache was last flushed.
int repopulateCache(const CfgSubnetPtrType cfg_subnets)
Repopulates the expression cache from the given subnet configuration.
void setGlobalHostnameExpression(dhcp::ExpressionPtr &expression)
Set the global hostname expression.
dhcp::ExpressionPtr getGlobalHostnameExpression()
Get the global hostname expression.
std::string calculateHostname(dhcp::PktPtr query, dhcp::ConstSubnetPtr subnet)
Calculate the hostname for a packet given a subnet.
dhcp::ExpressionPtr cacheExpression(dhcp::ConstSubnetPtr subnet)
Caches an expression entry for a given subnet.
size_t getCacheSize()
Fetches the number of entries in the cache.
ExpressionCache stores expressions per subnet.
const isc::log::MessageID DDNS_TUNING_SUBNET_EXPRESSION_PARSE_ERROR
#define LOG_ERROR(LOGGER, MESSAGE)
Macro to conveniently test error output and log it.
boost::shared_ptr< const Element > ConstElementPtr
isc::log::Logger ddns_tuning_logger("ddns-tuning-hooks")
boost::shared_ptr< DdnsTuningImpl > DdnsTuningImplPtr
The type of shared pointers to DDNS Tuning implementations.
boost::shared_ptr< isc::dhcp::Pkt > PktPtr
A pointer to either Pkt4 or Pkt6 packet.
boost::shared_ptr< Expression > ExpressionPtr
uint32_t SubnetID
Defines unique IPv4 or IPv6 subnet identifier.
boost::shared_ptr< const Subnet > ConstSubnetPtr
A generic pointer to either const Subnet4 or const Subnet6 object.
Defines the logger used by the top-level component of kea-lfc.