configure: Cleanup dbus variables

These are realistically not configurable by the end user and could be
provided as a runtime configuration if needed so that custom networkd
binaries are not needed for each different busname.

Configure variable substitution was kept to ensure the value is
consistent between all of the source files.

Change-Id: Ic6d50a80b48e2cfc07e48067089236010894e71b
Signed-off-by: William A. Kennington III <wak@google.com>
diff --git a/configure.ac b/configure.ac
index f8c2ef8..a6cdc3d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -105,13 +105,9 @@
     AC_DEFINE([LINK_LOCAL_AUTOCONFIGURATION], [1], [Enable link-local IP address autoconfiguration])
 fi
 
-AC_ARG_VAR(BUSNAME_NETWORK, [The Dbus busname to own])
-AS_IF([test "x$BUSNAME_NETWORK" == "x"], [BUSNAME_NETWORK="xyz.openbmc_project.Network"])
-AC_DEFINE_UNQUOTED([BUSNAME_NETWORK], ["$BUSNAME_NETWORK"], [The DBus busname to own])
-
-AC_ARG_VAR(OBJ_NETWORK, [The network manager DBus object path])
-AS_IF([test "x$OBJ_NETWORK" == "x"], [OBJ_NETWORK="/xyz/openbmc_project/network"])
-AC_DEFINE_UNQUOTED([OBJ_NETWORK], ["$OBJ_NETWORK"], [The network manager DBus object path])
+DEFAULT_BUSNAME='xyz.openbmc_project.Network'
+AC_DEFINE_UNQUOTED([DEFAULT_BUSNAME], ["$DEFAULT_BUSNAME"], [The DBus busname to own])
+AC_SUBST(DEFAULT_BUSNAME, ["$DEFAULT_BUSNAME"])
 
 AC_ARG_VAR(SYSTEMD_TARGET, "Target for starting this service")
 AS_IF([test "x$SYSTEMD_TARGET" == "x"], [SYSTEMD_TARGET="multi-user.target"])
diff --git a/network_manager_main.cpp b/network_manager_main.cpp
index 3dcefe5..1b85bfa 100644
--- a/network_manager_main.cpp
+++ b/network_manager_main.cpp
@@ -26,6 +26,8 @@
 constexpr char NETWORK_STATE_FILE[] = "/run/systemd/netif/state";
 constexpr char NETWORK_CONF_DIR[] = "/etc/systemd/network";
 
+constexpr char DEFAULT_OBJPATH[] = "/xyz/openbmc_project/network";
+
 namespace phosphor
 {
 namespace network
@@ -101,11 +103,11 @@
     bus.attach_event(eventPtr.get(), SD_EVENT_PRIORITY_NORMAL);
 
     // Add sdbusplus Object Manager for the 'root' path of the network manager.
-    sdbusplus::server::manager::manager objManager(bus, OBJ_NETWORK);
-    bus.request_name(BUSNAME_NETWORK);
+    sdbusplus::server::manager::manager objManager(bus, DEFAULT_OBJPATH);
+    bus.request_name(DEFAULT_BUSNAME);
 
     phosphor::network::manager = std::make_unique<phosphor::network::Manager>(
-        bus, OBJ_NETWORK, NETWORK_CONF_DIR);
+        bus, DEFAULT_OBJPATH, NETWORK_CONF_DIR);
 
     // create the default network files if the network file
     // is not there for any interface.
diff --git a/xyz.openbmc_project.Network.conf.in b/xyz.openbmc_project.Network.conf.in
index a81f2b0..b34fe6c 100644
--- a/xyz.openbmc_project.Network.conf.in
+++ b/xyz.openbmc_project.Network.conf.in
@@ -2,7 +2,7 @@
         "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
 <busconfig>
         <policy user="root">
-                <allow own="@BUSNAME_NETWORK@"/>
-                <allow send_destination="@BUSNAME_NETWORK@"/>
+                <allow own="@DEFAULT_BUSNAME@"/>
+                <allow send_destination="@DEFAULT_BUSNAME@"/>
         </policy>
 </busconfig>
diff --git a/xyz.openbmc_project.Network.service.in b/xyz.openbmc_project.Network.service.in
index 65c57ce..a478462 100644
--- a/xyz.openbmc_project.Network.service.in
+++ b/xyz.openbmc_project.Network.service.in
@@ -7,7 +7,7 @@
 SyslogIdentifier=phosphor-network-manager
 Restart=always
 Type=dbus
-BusName=@BUSNAME_NETWORK@
+BusName=@DEFAULT_BUSNAME@
 RuntimeDirectory = network
 RuntimeDirectoryPreserve = yes
 StateDirectory = network