Kea  1.9.9-git
csv_lease_file6.h
Go to the documentation of this file.
1 // Copyright (C) 2014-2021 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 
19 namespace isc {
20 namespace dhcp {
21 
34 public:
35 
41  CSVLeaseFile6(const std::string& filename);
42 
50  virtual void open(const bool seek_to_end = false);
51 
62  void append(const Lease6& lease);
63 
82  bool next(Lease6Ptr& lease);
83 
84 private:
85 
104  void initColumns();
105 
109 
110  Lease::Type readType(const util::CSVRow& row);
115 
119  asiolink::IOAddress readAddress(const util::CSVRow& row);
120 
124  DuidPtr readDUID(const util::CSVRow& row);
125 
129  uint32_t readIAID(const util::CSVRow& row);
130 
134  uint32_t readPreferred(const util::CSVRow& row);
135 
139  uint32_t readValid(const util::CSVRow& row);
140 
144  uint32_t readCltt(const util::CSVRow& row);
145 
149  SubnetID readSubnetID(const util::CSVRow& row);
150 
154  uint8_t readPrefixLen(const util::CSVRow& row);
155 
159  bool readFqdnFwd(const util::CSVRow& row);
160 
164  bool readFqdnRev(const util::CSVRow& row);
165 
169  std::string readHostname(const util::CSVRow& row);
170 
175  HWAddrPtr readHWAddr(const util::CSVRow& row);
176 
180  uint32_t readState(const util::CSVRow& row);
181 
185  data::ConstElementPtr readContext(const util::CSVRow& row);
187 
188 };
189 
190 } // namespace isc::dhcp
191 } // namespace isc
192 
193 #endif // CSV_LEASE_FILE6_H
boost::shared_ptr< DUID > DuidPtr
Definition: duid.h:20
boost::shared_ptr< HWAddr > HWAddrPtr
Shared pointer to a hardware address structure.
Definition: hwaddr.h:154
bool next(Lease6Ptr &lease)
Reads next lease from the CSV file.
boost::shared_ptr< const Element > ConstElementPtr
Definition: data.h:23
Structure that holds a lease for IPv6 address and/or prefix.
Definition: lease.h:503
Represents a single row of the CSV file.
Definition: csv_file.h:51
CSVLeaseFile6(const std::string &filename)
Constructor.
virtual void open(const bool seek_to_end=false)
Opens a lease file.
void append(const Lease6 &lease)
Appends the lease record to the CSV file.
Defines the logger used by the top-level component of kea-dhcp-ddns.
Provides statistics for leases.
Implements a CSV file that supports multiple versions of the file's "schema".
Type
Type of lease or pool.
Definition: lease.h:50
boost::shared_ptr< Lease6 > Lease6Ptr
Pointer to a Lease6 structure.
Definition: lease.h:492
Provides methods to access CSV file with DHCPv6 leases.
uint32_t SubnetID
Unique identifier for a subnet (both v4 and v6)
Definition: lease.h:24