34 }
catch (std::exception& ex) {
std::string cmd_name_
Stores the command name extracted by a call to extractCommand.
void extractCommand(hooks::CalloutHandle &handle)
Extracts the command name and arguments from a Callout handle.
ConstElementPtr createAnswer(const int status_code, const std::string &text, const ConstElementPtr &arg)
const int CONTROL_RESULT_SUCCESS
Status code indicating a successful operation.
const int CONTROL_RESULT_ERROR
Status code indicating a general failure.
virtual const char * what() const
Returns a C-style character string of the cause of the exception.
#define isc_throw(type, stream)
A shortcut macro to insert known values into exception arguments.
A generic exception that is thrown if a parameter given to a method is considered invalid in that con...
Per-packet callout handle.
boost::shared_ptr< const Element > ConstElementPtr
void setArgument(const std::string &name, T value)
Set argument.
void setResponse(hooks::CalloutHandle &handle, data::ConstElementPtr &response)
Set the callout argument "response" to the given response.
Defines the logger used by the top-level component of kea-dhcp-ddns.
std::string parseCommand(ConstElementPtr &arg, ConstElementPtr command)
void setSuccessResponse(hooks::CalloutHandle &handle, const std::string &text)
Set the callout argument "response" to indicate success.
void getArgument(const std::string &name, T &value) const
Get argument.
This file contains several functions and constants that are used for handling commands and responses ...
Base class that command handler implementers may use for common tasks.
data::ConstElementPtr cmd_args_
Stores the command arguments extracted by a call to extractCommand.
void setErrorResponse(hooks::CalloutHandle &handle, const std::string &text, int status=CONTROL_RESULT_ERROR)
Set the callout argument "response" to indicate an error.