Kea 2.7.5
|
Parses configuration parameters for a single DurationKey. More...
#include <perfmon_config.h>
Public Member Functions | |
DurationKeyParser ()=default | |
Constructor. | |
~DurationKeyParser ()=default | |
Destructor. | |
Static Public Member Functions | |
static uint16_t | getMessageNameType4 (const std::string &name) |
Convert string message name to DHCP message type. | |
static uint16_t | getMessageNameType6 (const std::string &name) |
Convert string message name to DHCP6 message type. | |
static uint16_t | getMessageType (data::ConstElementPtr config, uint16_t family, const std::string ¶m_name, bool required=true) |
Convert a configuration parameter to family-specific message type. | |
static DurationKeyPtr | parse (data::ConstElementPtr config, uint16_t family) |
Convert a map of Elements into a DurationKey. | |
static data::ElementPtr | toElement (DurationKeyPtr key) |
Convert a DurationKey into a map of Elements. | |
Static Public Attributes | |
static const data::SimpleKeywords | CONFIG_KEYWORDS |
List of valid parameters and expected types. | |
Parses configuration parameters for a single DurationKey.
DurationKey is used to identify both MonitoredDurations and Alarms, thus they could be use to define either in configuration as well as identifiy either in API calls. Given this, it seems prudent to define a "duration-key" element with its own parser.
Definition at line 57 of file perfmon_config.h.
|
explicitdefault |
Constructor.
|
default |
Destructor.
|
static |
Convert string message name to DHCP message type.
name | upper-case message name (e.g "DHCPDISCOVER", "DHCPOFFER"). |
BadValue | if the message name is unknown. |
Definition at line 33 of file perfmon_config.cc.
References isc::dhcp::DHCP_NOTYPE, isc::dhcp::DHCPACK, isc::dhcp::DHCPBULKLEASEQUERY, isc::dhcp::DHCPDECLINE, isc::dhcp::DHCPDISCOVER, isc::dhcp::DHCPINFORM, isc::dhcp::DHCPLEASEACTIVE, isc::dhcp::DHCPLEASEQUERY, isc::dhcp::DHCPLEASEQUERYDONE, isc::dhcp::DHCPLEASEQUERYSTATUS, isc::dhcp::DHCPLEASEUNASSIGNED, isc::dhcp::DHCPLEASEUNKNOWN, isc::dhcp::DHCPNAK, isc::dhcp::DHCPOFFER, isc::dhcp::DHCPRELEASE, isc::dhcp::DHCPREQUEST, isc::dhcp::DHCPTLS, and isc_throw.
Referenced by getMessageType().
|
static |
Convert string message name to DHCP6 message type.
name | upper-case message name (e.g "DHCPV6_SOLICIT", "DHCV6_REPLY"). |
BadValue | if the message name is unknown. |
Definition at line 64 of file perfmon_config.cc.
References DHCPV6_ACTIVELEASEQUERY, DHCPV6_ADVERTISE, DHCPV6_BNDREPLY, DHCPV6_BNDUPD, DHCPV6_CONFIRM, DHCPV6_CONNECT, DHCPV6_CONNECTREPLY, DHCPV6_CONTACT, DHCPV6_DECLINE, DHCPV6_DHCPV4_QUERY, DHCPV6_DHCPV4_RESPONSE, DHCPV6_DISCONNECT, DHCPV6_INFORMATION_REQUEST, DHCPV6_LEASEQUERY, DHCPV6_LEASEQUERY_DATA, DHCPV6_LEASEQUERY_DONE, DHCPV6_LEASEQUERY_REPLY, DHCPV6_NOTYPE, DHCPV6_POOLREQ, DHCPV6_POOLRESP, DHCPV6_REBIND, DHCPV6_RECONFIGURE, DHCPV6_RECONFIGURE_REPLY, DHCPV6_RECONFIGURE_REQUEST, DHCPV6_RELAY_FORW, DHCPV6_RELAY_REPL, DHCPV6_RELEASE, DHCPV6_RENEW, DHCPV6_REPLY, DHCPV6_REQUEST, DHCPV6_SOLICIT, DHCPV6_STARTTLS, DHCPV6_STATE, DHCPV6_UPDDONE, DHCPV6_UPDREQ, DHCPV6_UPDREQALL, and isc_throw.
Referenced by getMessageType().
|
static |
Convert a configuration parameter to family-specific message type.
config | element map containing the duration key parameters. |
family | protocol family AF_INET or AF_INET6. |
param_name | configuration parameter name. |
required | if true then function will throw if the parameter does not exist in the configuration. Defaults to true. |
DhcpConfigError | if parameter type or value is not valid, or when required is true and the parameter is not in the map. |
Definition at line 114 of file perfmon_config.cc.
References getMessageNameType4(), getMessageNameType6(), isc_throw, and isc::Exception::what().
Referenced by parse().
|
static |
Convert a map of Elements into a DurationKey.
config | element map containing the duration key parameters. |
family | protocol family AF_INET or AF_INET6. |
Definition at line 138 of file perfmon_config.cc.
References isc::data::SimpleParser::checkKeywords(), CONFIG_KEYWORDS, getMessageType(), and isc_throw.
Referenced by isc::perfmon::AlarmParser::parse().
|
static |
Convert a DurationKey into a map of Elements.
key | DurationKey to convert. |
Definition at line 174 of file perfmon_config.cc.
References isc::data::Element::create(), isc::data::Element::createMap(), isc::dhcp::Pkt4::getName(), isc::dhcp::Pkt6::getName(), and isc_throw.
|
static |
List of valid parameters and expected types.
Definition at line 60 of file perfmon_config.h.
Referenced by parse().