neighbor: Refactor object creation
Change-Id: Ic46d39f4717799ecce1c1fa84096f27e674e69a6
Signed-off-by: William A. Kennington III <wak@google.com>
diff --git a/src/ethernet_interface.hpp b/src/ethernet_interface.hpp
index d7342a8..7d14385 100644
--- a/src/ethernet_interface.hpp
+++ b/src/ethernet_interface.hpp
@@ -97,6 +97,9 @@
/** @brief Persistent map of IPAddress dbus objects and their names */
std::unordered_map<IfAddr, std::unique_ptr<IPAddress>> addrs;
+ /** @brief Persistent map of Neighbor dbus objects and their names */
+ std::unordered_map<InAddrAny, std::unique_ptr<Neighbor>> staticNeighbors;
+
/** @brief Updates the interface information based on new InterfaceInfo */
void updateInfo(const system::InterfaceInfo& info);
@@ -123,11 +126,6 @@
*/
ObjectPath neighbor(std::string ipAddress, std::string macAddress) override;
- /* @brief delete the dbus object of the given ipAddress.
- * @param[in] ipAddress - IP address.
- */
- void deleteStaticNeighborObject(std::string_view ipAddress);
-
/* @brief creates the dbus object(IPaddres) given in the address list.
* @param[in] addrs - address list for which dbus objects needs
* to create.
@@ -138,14 +136,6 @@
*/
void createStaticNeighborObjects();
- /* @brief Gets all the static neighbor entries.
- * @returns Static neighbor map.
- */
- inline const auto& getStaticNeighbors() const
- {
- return staticNeighbors;
- }
-
/** Set value of DHCPEnabled */
DHCPConf dhcpEnabled() const override;
DHCPConf dhcpEnabled(DHCPConf value) override;
@@ -240,23 +230,6 @@
using EthernetInterfaceIntf::defaultGateway6;
protected:
- /** @brief construct the ip address dbus object path.
- * @param[in] addressType - Type of ip address.
- * @param[in] ipAddress - IP address.
- * @param[in] prefixLength - Length of prefix.
- * @param[in] origin - The origin entry of the IP::Address
-
- * @return path of the address object.
- */
- std::string generateObjectPath(IP::Protocol addressType,
- std::string_view ipAddress,
- uint8_t prefixLength,
- IP::AddressOrigin origin) const;
-
- std::string
- generateStaticNeighborObjectPath(std::string_view ipAddress,
- std::string_view macAddress) const;
-
/** @brief get the NTP server list from the timsyncd dbus obj
*
*/
@@ -270,9 +243,6 @@
/** @brief Persistent sdbusplus DBus bus connection. */
sdbusplus::bus_t& bus;
- /** @brief Persistent map of Neighbor dbus objects and their names */
- string_umap<std::unique_ptr<Neighbor>> staticNeighbors;
-
/** @brief Dbus object path */
std::string objPath;