Kea 2.2.0
csv_lease_file6.h
Go to the documentation of this file.
1// Copyright (C) 2014-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 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
37public:
38
44 CSVLeaseFile6(const std::string& filename);
45
53 virtual void open(const bool seek_to_end = false);
54
65 void append(const Lease6& lease);
66
85 bool next(Lease6Ptr& lease);
86
87private:
88
109 void initColumns();
110
114
115
119 Lease::Type readType(const util::CSVRow& row);
120
124 asiolink::IOAddress readAddress(const util::CSVRow& row);
125
129 DuidPtr readDUID(const util::CSVRow& row);
130
134 uint32_t readIAID(const util::CSVRow& row);
135
139 uint32_t readPreferred(const util::CSVRow& row);
140
144 uint32_t readValid(const util::CSVRow& row);
145
149 uint32_t readCltt(const util::CSVRow& row);
150
154 SubnetID readSubnetID(const util::CSVRow& row);
155
159 uint8_t readPrefixLen(const util::CSVRow& row);
160
164 bool readFqdnFwd(const util::CSVRow& row);
165
169 bool readFqdnRev(const util::CSVRow& row);
170
174 std::string readHostname(const util::CSVRow& row);
175
180 HWAddrPtr readHWAddr(const util::CSVRow& row);
181
185 uint32_t readState(const util::CSVRow& row);
186
190 data::ConstElementPtr readContext(const util::CSVRow& row);
191
198 isc::util::Optional<uint16_t> readHWType(const util::CSVRow& row);
199
206 isc::util::Optional<uint32_t> readHWAddrSource(const util::CSVRow& row);
208};
209
210} // namespace isc::dhcp
211} // namespace isc
212
213#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
Implements a CSV file that supports multiple versions of the file's "schema".
boost::shared_ptr< const Element > ConstElementPtr
Definition: data.h:27
boost::shared_ptr< DUID > DuidPtr
Definition: duid.h:20
boost::shared_ptr< Lease6 > Lease6Ptr
Pointer to a Lease6 structure.
Definition: lease.h:503
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:24
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:514
Type
Type of lease or pool.
Definition: lease.h:46