Kea 2.7.6
csv_lease_file6.h
Go to the documentation of this file.
1// Copyright (C) 2014-2023 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 CSV_LEASE_FILE6_H
8#define CSV_LEASE_FILE6_H
9
10#include <asiolink/io_address.h>
11#include <dhcp/duid.h>
12#include <dhcpsrv/lease.h>
13#include <dhcpsrv/subnet.h>
15#include <util/optional.h>
17
18#include <stdint.h>
19
20#include <string>
21
22namespace isc {
23namespace dhcp {
24
36public:
37
43 CSVLeaseFile6(const std::string& filename);
44
52 virtual void open(const bool seek_to_end = false);
53
64 void append(const Lease6& lease);
65
83 bool next(Lease6Ptr& lease);
84
85private:
86
108 void initColumns();
109
113
114
118 Lease::Type readType(const util::CSVRow& row);
119
123 asiolink::IOAddress readAddress(const util::CSVRow& row);
124
128 DuidPtr readDUID(const util::CSVRow& row);
129
133 uint32_t readIAID(const util::CSVRow& row);
134
138 uint32_t readPreferred(const util::CSVRow& row);
139
143 uint32_t readValid(const util::CSVRow& row);
144
148 uint32_t readCltt(const util::CSVRow& row);
149
153 SubnetID readSubnetID(const util::CSVRow& row);
154
158 uint32_t readPoolID(const util::CSVRow& row);
159
163 uint8_t readPrefixLen(const util::CSVRow& row);
164
168 bool readFqdnFwd(const util::CSVRow& row);
169
173 bool readFqdnRev(const util::CSVRow& row);
174
178 std::string readHostname(const util::CSVRow& row);
179
184 HWAddrPtr readHWAddr(const util::CSVRow& row);
185
189 uint32_t readState(const util::CSVRow& row);
190
194 data::ConstElementPtr readContext(const util::CSVRow& row);
195
202 isc::util::Optional<uint16_t> readHWType(const util::CSVRow& row);
203
210 isc::util::Optional<uint32_t> readHWAddrSource(const util::CSVRow& row);
212};
213
214} // namespace isc::dhcp
215} // namespace isc
216
217#endif // CSV_LEASE_FILE6_H
Provides methods to access CSV file with DHCPv6 leases.
bool next(Lease6Ptr &lease)
Reads next lease from the CSV file.
void append(const Lease6 &lease)
Appends the lease record to the CSV file.
virtual void open(const bool seek_to_end=false)
Opens a lease file.
CSVLeaseFile6(const std::string &filename)
Constructor.
Provides statistics for leases.
Represents a single row of the CSV file.
Definition csv_file.h:51
A template representing an optional value.
Definition optional.h:36
Implements a CSV file that supports multiple versions of the file's "schema".
boost::shared_ptr< const Element > ConstElementPtr
Definition data.h:29
boost::shared_ptr< DUID > DuidPtr
Definition duid.h:136
boost::shared_ptr< Lease6 > Lease6Ptr
Pointer to a Lease6 structure.
Definition lease.h:508
boost::shared_ptr< HWAddr > HWAddrPtr
Shared pointer to a hardware address structure.
Definition hwaddr.h:154
uint32_t SubnetID
Defines unique IPv4 or IPv6 subnet identifier.
Definition subnet_id.h:25
Defines the logger used by the top-level component of kea-lfc.
Structure that holds a lease for IPv6 address and/or prefix.
Definition lease.h:516
Type
Type of lease or pool.
Definition lease.h:46