Remove gateway properties in SystemConfiguration

Now default gateway are per-interface properties, the system-wide one
in the SystemConfiguration interface is deprecated. Updating the value
also makes no difference, it will never be written to configuration.
This patch removes the code of initializing and updating them.

Change #52785 removes the properties in phosphor-dbus-interfaces yaml,
it is recommended to be merged after this change.

Tested:
In SystemConfiguration interface, DefaultGateway and DefaultGateway6 are
still there, but writing them only updates the displayed value on DBus.
No code in phosphor-networkd is called.

Change-Id: I58ac52c5318943941dcc92abede7763bddbca596
Signed-off-by: Jiaqing Zhao <jiaqing.zhao@intel.com>
diff --git a/src/system_configuration.cpp b/src/system_configuration.cpp
index ae7d270..b430bfc 100644
--- a/src/system_configuration.cpp
+++ b/src/system_configuration.cpp
@@ -2,8 +2,6 @@
 
 #include "system_configuration.hpp"
 
-#include "network_manager.hpp"
-
 #include <phosphor-logging/elog-errors.hpp>
 #include <phosphor-logging/log.hpp>
 #include <xyz/openbmc_project/Common/error.hpp>
@@ -23,36 +21,16 @@
 
 using namespace phosphor::logging;
 using namespace sdbusplus::xyz::openbmc_project::Common::Error;
-using InvalidArgumentMetadata = xyz::openbmc_project::Common::InvalidArgument;
 
 using SystemConfigIntf =
     sdbusplus::xyz::openbmc_project::Network::server::SystemConfiguration;
 
 SystemConfiguration::SystemConfiguration(sdbusplus::bus::bus& bus,
-                                         const std::string& objPath,
-                                         Manager& parent) :
+                                         const std::string& objPath) :
     Iface(bus, objPath.c_str(), Iface::action::defer_emit),
-    bus(bus), manager(parent)
+    bus(bus)
 {
-    auto name = getHostNameFromSystem();
-
-    SystemConfigIntf::hostName(name);
-    const auto& gatewayList = manager.getRouteTable().getDefaultGateway();
-    const auto& gateway6List = manager.getRouteTable().getDefaultGateway6();
-    // Assign first entry of gateway list
-    std::string gateway;
-    std::string gateway6;
-    if (!gatewayList.empty())
-    {
-        gateway = gatewayList.begin()->second;
-    }
-    if (!gateway6List.empty())
-    {
-        gateway6 = gateway6List.begin()->second;
-    }
-
-    SystemConfigIntf::defaultGateway(gateway);
-    SystemConfigIntf::defaultGateway6(gateway6);
+    SystemConfigIntf::hostName(getHostNameFromSystem());
 
     this->emit_object_added();
 }
@@ -103,53 +81,5 @@
     return "";
 }
 
-std::string SystemConfiguration::defaultGateway(std::string gateway)
-{
-    auto gw = SystemConfigIntf::defaultGateway();
-    if (gw == gateway)
-    {
-        return gw;
-    }
-
-    if (!isValidIP(AF_INET, gateway))
-    {
-        log<level::ERR>("Not a valid v4 Gateway",
-                        entry("GATEWAY=%s", gateway.c_str()));
-        elog<InvalidArgument>(
-            InvalidArgumentMetadata::ARGUMENT_NAME("GATEWAY"),
-            InvalidArgumentMetadata::ARGUMENT_VALUE(gateway.c_str()));
-    }
-    gw = SystemConfigIntf::defaultGateway(gateway);
-
-    manager.writeToConfigurationFile();
-    manager.reloadConfigs();
-
-    return gw;
-}
-
-std::string SystemConfiguration::defaultGateway6(std::string gateway)
-{
-    auto gw = SystemConfigIntf::defaultGateway6();
-    if (gw == gateway)
-    {
-        return gw;
-    }
-
-    if (!isValidIP(AF_INET6, gateway))
-    {
-        log<level::ERR>("Not a valid v6 Gateway",
-                        entry("GATEWAY=%s", gateway.c_str()));
-        elog<InvalidArgument>(
-            InvalidArgumentMetadata::ARGUMENT_NAME("GATEWAY"),
-            InvalidArgumentMetadata::ARGUMENT_VALUE(gateway.c_str()));
-    }
-    gw = SystemConfigIntf::defaultGateway6(gateway);
-
-    manager.writeToConfigurationFile();
-    manager.reloadConfigs();
-
-    return gw;
-}
-
 } // namespace network
 } // namespace phosphor