Kea
1.5.0
host_reservations_list_parser.h
Go to the documentation of this file.
1
// Copyright (C) 2014-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 HOST_RESERVATIONS_LIST_PARSER_H
8
#define HOST_RESERVATIONS_LIST_PARSER_H
9
10
#include <
cc/data.h
>
11
#include <
cc/simple_parser.h
>
12
#include <
dhcpsrv/host.h
>
13
#include <
dhcpsrv/subnet_id.h
>
14
#include <boost/foreach.hpp>
15
16
namespace
isc
{
17
namespace
dhcp {
18
24
template
<
typename
HostReservationParserType>
25
class
HostReservationsListParser
:
public
isc::data::SimpleParser
{
26
public
:
27
39
void
parse
(
const
SubnetID
& subnet_id,
isc::data::ConstElementPtr
hr_list,
40
HostCollection
& hosts_list) {
41
HostCollection
hosts;
42
BOOST_FOREACH(
data::ConstElementPtr
reservation, hr_list->listValue()) {
43
HostReservationParserType parser;
44
hosts.push_back(parser.parse(subnet_id, reservation));
45
}
46
hosts_list.swap(hosts);
47
}
48
};
49
50
}
51
}
52
53
#endif // HOST_RESERVATIONS_LIST_PARSER_H
host.h
isc
Defines the logger used by the top-level component of kea-dhcp-ddns.
Definition:
agent_parser.cc:144
isc::data::SimpleParser
A simple parser.
Definition:
lib/cc/simple_parser.h:60
isc::dhcp::HostReservationsListParser
Parser for a list of host reservations for a subnet.
Definition:
host_reservations_list_parser.h:25
data.h
subnet_id.h
isc::data::ConstElementPtr
boost::shared_ptr< const Element > ConstElementPtr
Definition:
data.h:23
isc::dhcp::SubnetID
uint32_t SubnetID
Unique identifier for a subnet (both v4 and v6)
Definition:
lease.h:24
isc::dhcp::HostReservationsListParser::parse
void parse(const SubnetID &subnet_id, isc::data::ConstElementPtr hr_list, HostCollection &hosts_list)
Parses a list of host reservation entries for a subnet.
Definition:
host_reservations_list_parser.h:39
simple_parser.h
isc::dhcp::HostCollection
std::vector< HostPtr > HostCollection
Collection of the Host objects.
Definition:
host.h:734
src
lib
dhcpsrv
parsers
host_reservations_list_parser.h
Generated on Fri Jul 10 2020 09:12:51 for Kea by
1.8.18