17 #include <boost/pointer_cast.hpp>
29 std::atomic<bool> NetconfProcess::shut_down(
false);
31 NetconfProcess::NetconfProcess(
const char* name,
49 std::thread th([
this]() {
72 std::exception_ptr eptr = std::current_exception();
75 std::rethrow_exception(eptr);
91 }
catch (
const std::exception& ex) {
99 "Process run method failed: " << ex.
what());
106 NetconfProcess::runIO() {
125 getCfgMgr()->simpleParseConfig(config_set, check_only);
133 return (boost::dynamic_pointer_cast<NetconfCfgMgr>(
getCfgMgr()));
void initSysrepo()
Initialize sysrepo sessions.
static std::atomic< bool > shut_down
Global (globally visible) shutdown flag.
virtual isc::data::ConstElementPtr configure(isc::data::ConstElementPtr config_set, bool check_only=false)
Processes the given configuration.
void setShutdownFlag(bool value)
Sets the process shut down flag to the given value.
#define LOG_INFO(LOGGER, MESSAGE)
Macro to conveniently test info output and log it.
ConstElementPtr createAnswer(const int status_code, const std::string &text, const ConstElementPtr &arg)
boost::shared_ptr< DCfgMgrBase > DCfgMgrBasePtr
Defines a shared pointer to DCfgMgrBase.
const isc::log::MessageID NETCONF_STARTED
const isc::log::MessageID NETCONF_FAILED
virtual ~NetconfProcess()
Destructor.
boost::shared_ptr< IOService > IOServicePtr
Defines a smart pointer to an IOService instance.
virtual void init()
Initialize the Netconf process.
Ctrl Netconf Configuration Manager.
bool shouldShutdown() const
Checks if the process has been instructed to shut down.
#define isc_throw(type, stream)
A shortcut macro to insert known values into exception arguments.
DCfgMgrBasePtr & getCfgMgr()
Fetches the process's configuration manager.
boost::shared_ptr< const Element > ConstElementPtr
virtual isc::data::ConstElementPtr shutdown(isc::data::ConstElementPtr args)
Initiates the process's shutdown process.
const isc::log::MessageID NETCONF_RUN_EXIT
isc::log::Logger netconf_logger(NETCONF_LOGGER_NAME)
Base logger for the netconf agent.
void stopIOService()
Convenience method for stopping IOservice processing.
virtual const char * what() const
Returns a C-style character string of the cause of the exception.
ConstElementPtr parseAnswer(int &rcode, const ConstElementPtr &msg)
Defines the logger used by the top-level component of kea-dhcp-ddns.
boost::shared_ptr< NetconfCfgMgr > NetconfCfgMgrPtr
Defines a shared pointer to NetconfCfgMgr.
This file contains several functions and constants that are used for handling commands and responses ...
asiolink::IOServicePtr & getIoService()
Fetches the controller's IOService.
Exception thrown if the process encountered an operational error.
#define LOG_DEBUG(LOGGER, LEVEL, MESSAGE)
Macro to conveniently test debug output and log it.
Contains declarations for loggers used by the Kea netconf agent.
Application Process Interface.
NetconfCfgMgrPtr getNetconfCfgMgr()
Returns a pointer to the configuration manager.
#define LOG_FATAL(LOGGER, MESSAGE)
Macro to conveniently test fatal output and log it.
void init(NetconfCfgMgrPtr cfg_mgr)
Initialization.
const int DBGLVL_START_SHUT
This is given a value of 0 as that is the level selected if debugging is enabled without giving a lev...
virtual void run()
Implements the process's event loop.