Kea 2.7.5
cfg_option_def.h
Go to the documentation of this file.
1// Copyright (C) 2014-2021 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 CFG_OPTION_DEF_H
8#define CFG_OPTION_DEF_H
9
12#include <cc/cfg_to_element.h>
13#include <string>
14
15namespace isc {
16namespace dhcp {
17
31public:
32
41 void copyTo(CfgOptionDef& new_config) const;
42
45
46
51 bool equals(const CfgOptionDef& other) const;
52
58 bool operator==(const CfgOptionDef& other) const {
59 return (equals(other));
60 }
61
67 bool operator!=(const CfgOptionDef& other) const {
68 return (!equals(other));
69 }
70
72
84 void add(const OptionDefinitionPtr& def);
85
93 OptionDefContainerPtr getAll(const std::string& option_space) const;
94
102 OptionDefinitionPtr get(const std::string& option_space,
103 const uint16_t option_code) const;
104
112 OptionDefinitionPtr get(const std::string& option_space,
113 const std::string& option_name) const;
114
128 uint64_t del(const uint64_t id);
129
132 return (option_definitions_);
133 }
134
138 virtual isc::data::ElementPtr toElement() const;
139
148 toElementWithMetadata(const bool include_metadata) const;
149
171 void merge(CfgOptionDef& other);
172
173private:
174
179 OptionDefSpaceContainer option_definitions_;
180
181};
182
184
185
186typedef boost::shared_ptr<CfgOptionDef> CfgOptionDefPtr;
187
189typedef boost::shared_ptr<const CfgOptionDef> ConstCfgOptionDefPtr;
190
192
193}
194}
195
196#endif // CFG_OPTION_DEF_H
Represents option definitions used by the DHCP server.
void add(const OptionDefinitionPtr &def)
Add new option definition.
bool operator!=(const CfgOptionDef &other) const
Inequality operator.
virtual isc::data::ElementPtr toElement() const
Unparse a configuration object.
isc::data::ElementPtr toElementWithMetadata(const bool include_metadata) const
Unparse a configuration object with optionally including the metadata.
uint64_t del(const uint64_t id)
Deletes all option definitions having a given database id.
const OptionDefSpaceContainer & getContainer() const
Returns reference to container holding option definitions.
OptionDefContainerPtr getAll(const std::string &option_space) const
Return option definitions for particular option space.
bool equals(const CfgOptionDef &other) const
Check if configuration is equal to other configuration.
void merge(CfgOptionDef &other)
Merges specified option definitions from a configuration into this configuration.
OptionDefinitionPtr get(const std::string &option_space, const uint16_t option_code) const
Return option definition for a particular option space and code.
bool operator==(const CfgOptionDef &other) const
Equality operator.
void copyTo(CfgOptionDef &new_config) const
Copies this configuration to a new configuration.
Class of option definition space container.
boost::shared_ptr< Element > ElementPtr
Definition data.h:28
boost::shared_ptr< const CfgOptionDef > ConstCfgOptionDefPtr
Const pointer.
boost::shared_ptr< CfgOptionDef > CfgOptionDefPtr
Non-const pointer.
boost::shared_ptr< OptionDefinition > OptionDefinitionPtr
Pointer to option definition object.
boost::shared_ptr< OptionDefContainer > OptionDefContainerPtr
Pointer to an option definition container.
Defines the logger used by the top-level component of kea-lfc.
Abstract class for configuration Cfg_* classes.