]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
Revert "[#2038] add hwtype,hwaddr_source to v6 memfile"
authorAndrei Pavel <andrei@isc.org>
Mon, 15 Nov 2021 16:01:22 +0000 (18:01 +0200)
committerAndrei Pavel <andrei@isc.org>
Mon, 15 Nov 2021 16:01:22 +0000 (18:01 +0200)
This reverts commit 08a219b8a217ffc220a1d137b6bf4e2f40163f62.

src/lib/dhcpsrv/csv_lease_file6.cc
src/lib/dhcpsrv/csv_lease_file6.h

index cee9647d4a8c42a7eda8cdcb6d3261b12933ad71..1164043cc6ccaf3bea4b969ca488a7dba11c17f4 100644 (file)
@@ -59,8 +59,6 @@ CSVLeaseFile6::append(const Lease6& lease) {
     if (lease.hwaddr_) {
         // We may not have hardware information
         row.writeAt(getColumnIndex("hwaddr"), lease.hwaddr_->toText(false));
-        row.writeAt(getColumnIndex("hwtype"), lease.hwaddr_->htype_);
-        row.writeAt(getColumnIndex("hwaddr_source"), lease.hwaddr_->source_);
     }
     row.writeAt(getColumnIndex("state"), lease.state_);
     // User context is optional.
@@ -150,8 +148,6 @@ CSVLeaseFile6::initColumns() {
     addColumn("fqdn_rev", "1.0");
     addColumn("hostname", "1.0");
     addColumn("hwaddr", "2.0");
-    addColumn("hwtype", "4.0", "1" /* == HTYPE_ETHER */);
-    addColumn("hwaddr_source", "4.0", "0" /* == HWADDR_SOURCE_UNKNOWN */);
     addColumn("state", "3.0", "0");
     addColumn("user_context", "3.1");
     // Any file with less than hostname is invalid
@@ -239,14 +235,11 @@ HWAddrPtr
 CSVLeaseFile6::readHWAddr(const CSVRow& row) {
 
     try {
-        uint16_t hwtype(readHWType(row));
-        HWAddr hwaddr(HWAddr::fromText(row.readAt(getColumnIndex("hwaddr")), hwtype));
+        const HWAddr& hwaddr = HWAddr::fromText(row.readAt(getColumnIndex("hwaddr")));
         if (hwaddr.hwaddr_.empty()) {
             return (HWAddrPtr());
         }
 
-        hwaddr.source_ = readHWAddrSource(row);
-
         /// @todo: HWAddr returns an object, not a pointer. Without HWAddr
         /// refactoring, at least one copy is unavoidable.
 
@@ -263,16 +256,6 @@ CSVLeaseFile6::readHWAddr(const CSVRow& row) {
     }
 }
 
-uint16_t
-CSVLeaseFile6::readHWType(const CSVRow& row) {
-    return row.readAndConvertAt<uint16_t>(getColumnIndex("hwtype"));
-}
-
-uint32_t
-CSVLeaseFile6::readHWAddrSource(const CSVRow& row) {
-    return row.readAndConvertAt<uint32_t>(getColumnIndex("hwaddr_source"));
-}
-
 uint32_t
 CSVLeaseFile6::readState(const util::CSVRow& row) {
     uint32_t state = row.readAndConvertAt<uint32_t>(getColumnIndex("state"));
index b4b6e36581995ec82b203e2349bff88f95e7bbba..1dec282c58b4696746562ef82166dee1497fb5b7 100644 (file)
@@ -99,8 +99,6 @@ private:
     /// - fqdn_rev
     /// - hostname
     /// - hwaddr
-    /// - hwtype
-    /// - hwaddr_source
     /// - state
     /// - user_context
     void initColumns();
@@ -176,18 +174,6 @@ private:
     /// @return pointer to the HWAddr structure that was read
     HWAddrPtr readHWAddr(const util::CSVRow& row);
 
-    /// @brief Reads hardware address type from the CSV file row.
-    ///
-    /// @param row CSV file row holding lease information.
-    /// @return pointer to the HWAddr structure that was read
-    uint16_t readHWType(const util::CSVRow& row);
-
-    /// @brief Reads hardware address source from the CSV file row.
-    ///
-    /// @param row CSV file row holding lease information.
-    /// @return pointer to the HWAddr structure that was read
-    uint32_t readHWAddrSource(const util::CSVRow& row);
-
     /// @brief Reads lease state from the CSV file row.
     ///
     /// @param row CSV file row holding lease information.