Kea  1.5.0
isc::dhcp::SimpleParser4 Class Reference

#include <simple_parser4.h>

+ Inheritance diagram for isc::dhcp::SimpleParser4:

Static Public Member Functions

static size_t deriveParameters (isc::data::ElementPtr global)
 Derives (inherits) all parameters from global to more specific scopes. More...
 
static size_t setAllDefaults (isc::data::ElementPtr global)
 Sets all defaults for DHCPv4 configuration. More...
 
- Static Public Member Functions inherited from isc::data::SimpleParser
static size_t deriveParams (isc::data::ConstElementPtr parent, isc::data::ElementPtr child, const ParamsList &params)
 Derives (inherits) parameters from parent scope to a child. More...
 
static isc::asiolink::IOAddress getAddress (const ConstElementPtr &scope, const std::string &name)
 Returns a IOAddress parameter from a scope. More...
 
static bool getBoolean (isc::data::ConstElementPtr scope, const std::string &name)
 Returns a boolean parameter from a scope. More...
 
static int64_t getInteger (isc::data::ConstElementPtr scope, const std::string &name)
 Returns an integer parameter from a scope. More...
 
static const data::Element::PositiongetPosition (const std::string &name, const data::ConstElementPtr parent)
 Utility method that returns position of an element. More...
 
static std::string getString (isc::data::ConstElementPtr scope, const std::string &name)
 Returns a string parameter from a scope. More...
 
static size_t setDefaults (isc::data::ElementPtr scope, const SimpleDefaults &default_values)
 Sets the default values. More...
 
static size_t setListDefaults (isc::data::ConstElementPtr list, const SimpleDefaults &default_values)
 Sets the default values for all entries in a list. More...
 

Static Public Attributes

static const isc::data::SimpleDefaults OPTION4_DEF_DEFAULTS
 This table defines default values for option definitions in DHCPv4. More...
 
static const isc::data::SimpleDefaults OPTION4_DEFAULTS
 This table defines default values for options in DHCPv4. More...
 
static const isc::data::SimpleDefaults GLOBAL4_DEFAULTS
 This table defines default global values for DHCPv4. More...
 
static const isc::data::SimpleDefaults SUBNET4_DEFAULTS
 This table defines default values for each IPv4 subnet. More...
 
static const isc::data::SimpleDefaults SHARED_SUBNET4_DEFAULTS
 This table defines default values for each IPv4 subnet that is part of a shared network. More...
 
static const isc::data::SimpleDefaults SHARED_NETWORK4_DEFAULTS
 This table defines default values for each IPv4 shared network. More...
 
static const isc::data::SimpleDefaults IFACE4_DEFAULTS
 This table defines default values for interfaces for DHCPv4. More...
 
static const isc::data::SimpleDefaults DHCP_QUEUE_CONTROL4_DEFAULTS
 This table defines default values for dhcp-queue-control in DHCPv4. More...
 
static const isc::data::ParamsList INHERIT_TO_SUBNET4
 List of parameters that can be inherited to subnet4 scope. More...
 

Additional Inherited Members

- Public Member Functions inherited from isc::data::SimpleParser
uint16_t getUint16 (isc::data::ConstElementPtr scope, const std::string &name)
 Returns a value converted to uint16_t. More...
 
uint32_t getUint32 (isc::data::ConstElementPtr scope, const std::string &name)
 Returns a value converted to uint32_t. More...
 
uint8_t getUint8 (ConstElementPtr scope, const std::string &name)
 Get an uint8_t value. More...
 
- Protected Member Functions inherited from isc::data::SimpleParser
template<typename target_type , target_type convert>
target_type getAndConvert (isc::data::ConstElementPtr scope, const std::string &name, const std::string &type_name)
 Returns a converted value from a scope. More...
 
template<typename int_type >
int_type getIntType (isc::data::ConstElementPtr scope, const std::string &name)
 Returns an integer value with range checking from a scope. More...
 

Detailed Description

Definition at line 21 of file simple_parser4.h.

Member Function Documentation

◆ deriveParameters()

size_t isc::dhcp::SimpleParser4::deriveParameters ( isc::data::ElementPtr  global)
static

Derives (inherits) all parameters from global to more specific scopes.

This method currently does the following:

  • derives global parameters to subnets (lifetimes for now)
    Parameters
    globalscope to be modified if needed (subnet4 will be extracted)
    Returns
    number of default values derived

Definition at line 215 of file simple_parser4.cc.

References isc::data::SimpleParser::deriveParams().

+ Here is the call graph for this function:

◆ setAllDefaults()

size_t isc::dhcp::SimpleParser4::setAllDefaults ( isc::data::ElementPtr  global)
static

Sets all defaults for DHCPv4 configuration.

This method sets global, option data and option definitions defaults.

Parameters
globalscope to be filled in with defaults.
Returns
number of default values added

— end of default values ----------------------------------------------—

Definition at line 152 of file simple_parser4.cc.

References isc::data::Element::createMap(), and isc::data::SimpleParser::setDefaults().

+ Here is the call graph for this function:

Member Data Documentation

◆ DHCP_QUEUE_CONTROL4_DEFAULTS

const SimpleDefaults isc::dhcp::SimpleParser4::DHCP_QUEUE_CONTROL4_DEFAULTS
static
Initial value:
= {
{ "enable-queue", Element::boolean, "false"},
{ "queue-type", Element::string, "kea-ring4"},
{ "capacity", Element::integer, "500"}
}

This table defines default values for dhcp-queue-control in DHCPv4.

Definition at line 47 of file simple_parser4.h.

◆ GLOBAL4_DEFAULTS

const SimpleDefaults isc::dhcp::SimpleParser4::GLOBAL4_DEFAULTS
static
Initial value:
= {
{ "valid-lifetime", Element::integer, "7200" },
{ "decline-probation-period", Element::integer, "86400" },
{ "dhcp4o6-port", Element::integer, "0" },
{ "echo-client-id", Element::boolean, "true" },
{ "match-client-id", Element::boolean, "true" },
{ "authoritative", Element::boolean, "false" },
{ "next-server", Element::string, "0.0.0.0" },
{ "server-hostname", Element::string, "" },
{ "boot-file-name", Element::string, "" },
{ "server-tag", Element::string, "" },
{ "reservation-mode", Element::string, "all" }
}

This table defines default global values for DHCPv4.

Some of the global parameters defined in the global scope (i.e. directly in Dhcp4) are optional. If not defined, the following values will be used.

Definition at line 42 of file simple_parser4.h.

◆ IFACE4_DEFAULTS

const SimpleDefaults isc::dhcp::SimpleParser4::IFACE4_DEFAULTS
static
Initial value:
= {
{ "re-detect", Element::boolean, "true" }
}

This table defines default values for interfaces for DHCPv4.

Definition at line 46 of file simple_parser4.h.

◆ INHERIT_TO_SUBNET4

const ParamsList isc::dhcp::SimpleParser4::INHERIT_TO_SUBNET4
static
Initial value:
= {
"boot-file-name",
"client-class",
"interface",
"match-client-id",
"authoritative",
"next-server",
"rebind-timer",
"relay",
"renew-timer",
"reservation-mode",
"server-hostname",
"valid-lifetime"
}

List of parameters that can be inherited to subnet4 scope.

Some parameters may be defined on both global (directly in Dhcp4) and subnet (Dhcp4/subnet4/...) scope. If not defined in the subnet scope, the value is being inherited (derived) from the global scope. This array lists all of such parameters.

This list is also used for inheriting from global to shared networks and from shared networks to subnets within it.

Definition at line 48 of file simple_parser4.h.

◆ OPTION4_DEF_DEFAULTS

const SimpleDefaults isc::dhcp::SimpleParser4::OPTION4_DEF_DEFAULTS
static
Initial value:
= {
{ "record-types", Element::string, ""},
{ "space", Element::string, "dhcp4"},
{ "array", Element::boolean, "false"},
{ "encapsulate", Element::string, "" }
}

This table defines default values for option definitions in DHCPv4.

Dhcp4 may contain an array called option-def that enumerates new option definitions. This array lists default values for those option definitions.

Definition at line 40 of file simple_parser4.h.

◆ OPTION4_DEFAULTS

const SimpleDefaults isc::dhcp::SimpleParser4::OPTION4_DEFAULTS
static
Initial value:
= {
{ "space", Element::string, "dhcp4"},
{ "csv-format", Element::boolean, "true"},
{ "always-send", Element::boolean, "false"}
}

This table defines default values for options in DHCPv4.

Dhcp4 usually contains option values (option-data) defined in global, subnet, class or host reservations scopes. This array lists default values for those option-data declarations.

Definition at line 41 of file simple_parser4.h.

◆ SHARED_NETWORK4_DEFAULTS

const SimpleDefaults isc::dhcp::SimpleParser4::SHARED_NETWORK4_DEFAULTS
static
Initial value:
= {
{ "client-class", Element::string, "" },
{ "interface", Element::string, "" }
}

This table defines default values for each IPv4 shared network.

Definition at line 45 of file simple_parser4.h.

◆ SHARED_SUBNET4_DEFAULTS

const SimpleDefaults isc::dhcp::SimpleParser4::SHARED_SUBNET4_DEFAULTS
static
Initial value:
= {
{ "id", Element::integer, "0" },
{ "4o6-interface", Element::string, "" },
{ "4o6-interface-id", Element::string, "" },
{ "4o6-subnet", Element::string, "" },
}

This table defines default values for each IPv4 subnet that is part of a shared network.

This is mostly the same as SUBNET4_DEFAULTS, except two parameters that can be derived from shared-network, but cannot from global scope. Those are: interface and reservation-mode.

Definition at line 44 of file simple_parser4.h.

◆ SUBNET4_DEFAULTS

const SimpleDefaults isc::dhcp::SimpleParser4::SUBNET4_DEFAULTS
static
Initial value:
= {
{ "id", Element::integer, "0" },
{ "interface", Element::string, "" },
{ "client-class", Element::string, "" },
{ "4o6-interface", Element::string, "" },
{ "4o6-interface-id", Element::string, "" },
{ "4o6-subnet", Element::string, "" },
}

This table defines default values for each IPv4 subnet.

Note: When updating this array, please also update SHARED_SUBNET4_DEFAULTS below. In most cases, those two should be kept in sync, except cases where a parameter can be derived from shared-networks, but is not defined on global level. Currently there are two such parameters: interface and reservation-mode

Definition at line 43 of file simple_parser4.h.


The documentation for this class was generated from the following files: