Kea: cfg_hosts_util.h Source File

| Kea 3.2.0-git

cfg_hosts_util.h
Go to the documentation of this file.
1// Copyright (C) 2017 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_HOSTS_UTIL_H
8#define CFG_HOSTS_UTIL_H
9
10#include <cc/data.h>
11#include <dhcpsrv/subnet_id.h>
12
13namespace isc {
14namespace dhcp {
15
18 class CfgHostsList {
19public:
20
22 typedef std::map<SubnetID, isc::data::ElementPtr> CfgHostsMap;
23
29 void internalize(isc::data::ConstElementPtr list);
30
34 isc::data::ElementPtr externalize() const;
35
37 void add(SubnetID id, isc::data::ElementPtr resv);
38
43 isc::data::ConstElementPtr get(SubnetID id) const;
44
45private:
47 CfgHostsMap map_;
48};
49
50}
51}
52
53#endif // CFG_HOSTS_UTIL_H
isc::dhcp::CfgHostsList
Utility class to represent host reservation configurations internally as a map keyed by subnet IDs,...
Definition cfg_hosts_util.h:18
isc::dhcp::CfgHostsList::CfgHostsMap
std::map< SubnetID, isc::data::ElementPtr > CfgHostsMap
The type of the internal map.
Definition cfg_hosts_util.h:22
isc::dhcp::CfgHostsList::get
isc::data::ConstElementPtr get(SubnetID id) const
Return the host reservations for a subnet ID.
Definition cfg_hosts_util.cc:85
isc::dhcp::CfgHostsList::internalize
void internalize(isc::data::ConstElementPtr list)
Internalize a list Element.
Definition cfg_hosts_util.cc:20
isc::dhcp::CfgHostsList::add
void add(SubnetID id, isc::data::ElementPtr resv)
Add a host reservation to the map.
Definition cfg_hosts_util.cc:74
isc::dhcp::CfgHostsList::externalize
isc::data::ElementPtr externalize() const
Externalize the map to a list Element.
Definition cfg_hosts_util.cc:63
data.h
isc::data::ConstElementPtr
boost::shared_ptr< const Element > ConstElementPtr
Definition data.h:30
isc::data::ElementPtr
boost::shared_ptr< Element > ElementPtr
Definition data.h:29
isc::dhcp
Definition dhcp4/client_handler.cc:20
isc::dhcp::SubnetID
uint32_t SubnetID
Defines unique IPv4 or IPv6 subnet identifier.
Definition subnet_id.h:25
isc
Defines the logger used by the top-level component of kea-lfc.
Definition check_exists_add.cc:18
subnet_id.h