Kea 1.5.0
csv_lease_file6.h
Go to the documentation of this file.
1// Copyright (C) 2014-2018 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>
16#include <stdint.h>
17#include <string>
18
19namespace isc {
20namespace dhcp {
21
34public:
35
41 CSVLeaseFile6(const std::string& filename);
42
50 virtual void open(const bool seek_to_end = false);
51
60 void append(const Lease6& lease);
61
80 bool next(Lease6Ptr& lease);
81
82private:
83
102 void initColumns();
103
107
108
112 Lease::Type readType(const util::CSVRow& row);
113
117 asiolink::IOAddress readAddress(const util::CSVRow& row);
118
122 DuidPtr readDUID(const util::CSVRow& row);
123
127 uint32_t readIAID(const util::CSVRow& row);
128
132 uint32_t readPreferred(const util::CSVRow& row);
133
137 uint32_t readValid(const util::CSVRow& row);
138
142 uint32_t readCltt(const util::CSVRow& row);
143
147 SubnetID readSubnetID(const util::CSVRow& row);
148
152 uint8_t readPrefixLen(const util::CSVRow& row);
153
157 bool readFqdnFwd(const util::CSVRow& row);
158
162 bool readFqdnRev(const util::CSVRow& row);
163
167 std::string readHostname(const util::CSVRow& row);
168
173 HWAddrPtr readHWAddr(const util::CSVRow& row);
174
178 uint32_t readState(const util::CSVRow& row);
179
183 data::ConstElementPtr readContext(const util::CSVRow& row);
185
186};
187
188} // namespace isc::dhcp
189} // namespace isc
190
191#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.
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:23
boost::shared_ptr< DUID > DuidPtr
Definition: duid.h:21
boost::shared_ptr< Lease6 > Lease6Ptr
Pointer to a Lease6 structure.
Definition: lease.h:463
boost::shared_ptr< HWAddr > HWAddrPtr
Shared pointer to a hardware address structure.
Definition: hwaddr.h:154
uint32_t SubnetID
Unique identifier for a subnet (both v4 and v6)
Definition: lease.h:24
Defines the logger used by the top-level component of kea-dhcp-ddns.
Structure that holds a lease for IPv6 address and/or prefix.
Definition: lease.h:471
Type
Type of lease or pool.
Definition: lease.h:38