Kea 2.5.6
adaptor_config.h
Go to the documentation of this file.
1// Copyright (C) 2018-2022 Internet Systems Consortium, Inc. ("ISC")
2//
3// This Source Code Form is subject to the terms of the Mozilla Public
4// License, v. 2.0. If a copy of the MPL was not distributed with this
5// file, You can obtain one at http://mozilla.org/MPL/2.0/.
6
7#ifndef ISC_ADAPTOR_CONFIG_H
8#define ISC_ADAPTOR_CONFIG_H 1
9
10#include <dhcpsrv/subnet_id.h>
11#include <yang/adaptor_host.h>
12#include <yang/adaptor_option.h>
13#include <yang/adaptor_pool.h>
14#include <yang/adaptor_subnet.h>
15
16namespace isc {
17namespace yang {
18
26 public AdaptorSubnet {
27public:
38 static void preProcess4(isc::data::ElementPtr config);
39
50 static void preProcess6(isc::data::ElementPtr config);
51
52protected:
65
79 const std::string& subsel);
80
92
105 const std::string& subsel);
106
113 static void sanitizePools(isc::data::ConstElementPtr pools);
114
119
125 const std::string& subsel);
126
136 const std::string& space,
137 OptionCodes& codes);
138
145 const std::string& space,
146 const OptionCodes& codes);
147
155 const std::string& space,
156 OptionCodes& codes);
157
164 const std::string& space,
165 const OptionCodes& codes);
166
173 const std::string& space,
174 const OptionCodes& codes);
175
182 const std::string& space,
183 const OptionCodes& codes);
184
191 const std::string& space,
192 const OptionCodes& codes);
193
200
207
215 const std::string& subsel);
216
223
230
238 const std::string& space);
239
246
254 const std::string& subsel);
255
261 static void sanitizeDatabase(isc::data::ElementPtr dhcp);
262
269
278 static void preProcess(isc::data::ElementPtr dhcp,
279 const std::string& subsel,
280 const std::string& space);
281}; // AdaptorConfig
282
283} // namespace yang
284} // namespace isc
285
286#endif // ISC_ADAPTOR_CONFIG_H
JSON adaptor for Kea server configurations.
static void sanitizeRequireClassesPools(isc::data::ConstElementPtr pools)
Process require client classes in a pool list.
static void subnetsAssignID(isc::data::ConstElementPtr subnets, isc::dhcp::SubnetIDSet &set, isc::dhcp::SubnetID &next)
Assigns subnet-id to every subnet in a subnet list.
static void sanitizeOptionSharedNetworks(isc::data::ConstElementPtr networks, const std::string &space, const OptionCodes &codes)
Set missing option codes to a shared network list.
static void sharedNetworksAssignID(isc::data::ConstElementPtr networks, isc::dhcp::SubnetIDSet &set, isc::dhcp::SubnetID &next, const std::string &subsel)
Assigns subnet-id to every subnet in a shared network list.
static void sanitizeRelaySubnets(isc::data::ConstElementPtr subnets)
Sanitizes relay information in subnets in a subnet list.
static void sanitizeHostSubnets(isc::data::ConstElementPtr subnets)
Process host reservations in a subnet list.
static bool subnetsCollectID(isc::data::ConstElementPtr subnets, isc::dhcp::SubnetIDSet &set)
Collects subnet-ids on all subnets.
static void preProcess4(isc::data::ElementPtr config)
Pre process a DHCPv4 configuration.
static void sanitizeOptionPools(isc::data::ConstElementPtr pools, const std::string &space, const OptionCodes &codes)
Set missing option codes to a pool list.
static void preProcess(isc::data::ElementPtr dhcp, const std::string &subsel, const std::string &space)
Pre process a configuration.
static void sanitizePoolsInSubnets(isc::data::ConstElementPtr subnets)
Sanitizes all pools in a subnets list.
static void sanitizeDatabase(isc::data::ElementPtr dhcp)
Update (hosts) database.
static void requireClassesSharedNetworks(isc::data::ConstElementPtr networks, const std::string &subsel)
Process require client classes in a shared network list.
static void sanitizeOptionHosts(isc::data::ConstElementPtr hosts, const std::string &space, const OptionCodes &codes)
Set missing option codes to a host reservation list.
static void sanitizeHostList(isc::data::ConstElementPtr hosts)
Process host reservation list.
static void SanitizeHostsInSharedNetworks(isc::data::ConstElementPtr networks, const std::string &space)
Process host reservations in a shared network list.
static void sanitizeOptionDefList(isc::data::ConstElementPtr defs, const std::string &space, OptionCodes &codes)
Collect option definitions from an option definition list.
static void sanitizeRequireClassesSubnets(isc::data::ConstElementPtr subnets)
Process require client classes in a subnet list.
static void sanitizeOptionSubnets(isc::data::ConstElementPtr subnets, const std::string &space, const OptionCodes &codes)
Set missing option codes to a subnet list.
static void sanitizePools(isc::data::ConstElementPtr pools)
Sanitizes all pools in a pools list.
static void sanitizePoolsInSharedNetworks(isc::data::ConstElementPtr networks, const std::string &subsel)
Sanitizes all pools in all subnets in a shared network list.
static void sanitizeOptionClasses(isc::data::ConstElementPtr classes, const std::string &space, OptionCodes &codes)
Collect option definitions from a client class list and set missing option codes.
static void preProcess6(isc::data::ElementPtr config)
Pre process a DHCPv6 configuration.
static void sanitizeRelaySuppliedOptions(isc::data::ElementPtr dhcp)
Update relay supplied options.
static void sanitizeOptionDataList(isc::data::ConstElementPtr options, const std::string &space, const OptionCodes &codes)
Set missing option codes to an option data list.
static void sanitizeRelayInSharedNetworks(isc::data::ConstElementPtr networks, const std::string &subsel)
Sanitizes relay information in a shared network list.
static bool sharedNetworksCollectID(isc::data::ConstElementPtr networks, isc::dhcp::SubnetIDSet &set, const std::string &subsel)
Collects subnet-ids in all subnets in all shared network list.
JSON adaptor for host reservations quoting identifiers.
Definition: adaptor_host.h:21
JSON adaptor for option data or definition setting defaults.
JSON adaptor for subnets adding IDs and canonizes relays.
boost::shared_ptr< const Element > ConstElementPtr
Definition: data.h:29
boost::shared_ptr< Element > ElementPtr
Definition: data.h:28
std::set< dhcp::SubnetID > SubnetIDSet
Ordered list aka set of subnetIDs.
Definition: subnet_id.h:43
uint32_t SubnetID
Defines unique IPv4 or IPv6 subnet identifier.
Definition: subnet_id.h:25
std::unordered_map< std::string, uint16_t > OptionCodes
Map for DHCP option definitions handling code and an index built from space and name.
Defines the logger used by the top-level component of kea-lfc.