Kea  1.5.0
csv_lease_file4.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_FILE4_H
8 #define CSV_LEASE_FILE4_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 #include <time.h>
19 
20 namespace isc {
21 namespace dhcp {
22 
35 public:
36 
42  CSVLeaseFile4(const std::string& filename);
43 
51  virtual void open(const bool seek_to_end = false);
52 
61  void append(const Lease4& lease);
62 
81  bool next(Lease4Ptr& lease);
82 
83 private:
84 
99  void initColumns();
100 
104 
105  asiolink::IOAddress readAddress(const util::CSVRow& row);
110 
114  HWAddr readHWAddr(const util::CSVRow& row);
115 
119  ClientIdPtr readClientId(const util::CSVRow& row);
120 
124  uint32_t readValid(const util::CSVRow& row);
125 
129  time_t readCltt(const util::CSVRow& row);
130 
134  SubnetID readSubnetID(const util::CSVRow& row);
135 
139  bool readFqdnFwd(const util::CSVRow& row);
140 
144  bool readFqdnRev(const util::CSVRow& row);
145 
149  std::string readHostname(const util::CSVRow& row);
150 
154  uint32_t readState(const util::CSVRow& row);
155 
159  data::ConstElementPtr readContext(const util::CSVRow& row);
161 
162 };
163 
164 } // namespace isc::dhcp
165 } // namespace isc
166 
167 #endif // CSV_LEASE_FILE4_H
isc::dhcp::Lease4Ptr
boost::shared_ptr< Lease4 > Lease4Ptr
Pointer to a Lease4 structure.
Definition: lease.h:245
io_address.h
duid.h
isc::dhcp::LeaseFileStats
Provides statistics for leases.
Definition: lease_file_stats.h:18
isc::dhcp::CSVLeaseFile4::next
bool next(Lease4Ptr &lease)
Reads next lease from the CSV file.
Definition: csv_lease_file4.cc:75
isc::dhcp::HWAddr
Hardware type that represents information from DHCPv4 packet.
Definition: hwaddr.h:20
isc::dhcp::CSVLeaseFile4::open
virtual void open(const bool seek_to_end=false)
Opens a lease file.
Definition: csv_lease_file4.cc:24
isc
Defines the logger used by the top-level component of kea-dhcp-ddns.
Definition: agent_parser.cc:144
isc::dhcp::CSVLeaseFile4::append
void append(const Lease4 &lease)
Appends the lease record to the CSV file.
Definition: csv_lease_file4.cc:33
isc::util::CSVRow
Represents a single row of the CSV file.
Definition: csv_file.h:51
subnet.h
isc::dhcp::CSVLeaseFile4::CSVLeaseFile4
CSVLeaseFile4(const std::string &filename)
Constructor.
Definition: csv_lease_file4.cc:18
isc::util::VersionedCSVFile
Implements a CSV file that supports multiple versions of the file's "schema".
Definition: versioned_csv_file.h:120
lease_file_stats.h
versioned_csv_file.h
isc::dhcp::ClientIdPtr
boost::shared_ptr< ClientId > ClientIdPtr
Shared pointer to a Client ID.
Definition: duid.h:103
isc::dhcp::CSVLeaseFile4
Provides methods to access CSV file with DHCPv4 leases.
Definition: csv_lease_file4.h:34
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
lease.h
isc::dhcp::Lease4
Structure that holds a lease for IPv4 address.
Definition: lease.h:256