summaryrefslogtreecommitdiffstats
path: root/network_manager_main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'network_manager_main.cpp')
-rw-r--r--network_manager_main.cpp35
1 files changed, 16 insertions, 19 deletions
diff --git a/network_manager_main.cpp b/network_manager_main.cpp
index 89ba7b3..5f6b81b 100644
--- a/network_manager_main.cpp
+++ b/network_manager_main.cpp
@@ -1,4 +1,5 @@
#include "config.h"
+
#include "dns_updater.hpp"
#include "network_manager.hpp"
#include "rtnetlink_server.hpp"
@@ -41,16 +42,16 @@ void restartNetwork()
restartSystemdUnit("systemd-networkd.service");
}
-} //namespace network
-} //namespace phosphor
+} // namespace network
+} // namespace phosphor
void initializeTimers()
{
std::function<void()> refreshFunc(
- std::bind(&phosphor::network::refreshObjects));
+ std::bind(&phosphor::network::refreshObjects));
std::function<void()> restartFunc(
- std::bind(&phosphor::network::restartNetwork));
+ std::bind(&phosphor::network::restartNetwork));
phosphor::network::refreshObjectTimer =
std::make_unique<phosphor::network::Timer>(refreshFunc);
@@ -62,9 +63,9 @@ void initializeTimers()
void createNetLinkSocket(phosphor::Descriptor& smartSock)
{
using namespace phosphor::logging;
- using InternalFailure = sdbusplus::xyz::openbmc_project::Common::
- Error::InternalFailure;
- //RtnetLink socket
+ using InternalFailure =
+ sdbusplus::xyz::openbmc_project::Common::Error::InternalFailure;
+ // RtnetLink socket
auto fd = socket(PF_NETLINK, SOCK_RAW | SOCK_NONBLOCK, NETLINK_ROUTE);
if (fd < 0)
{
@@ -76,9 +77,7 @@ void createNetLinkSocket(phosphor::Descriptor& smartSock)
smartSock.set(fd);
}
-
-
-int main(int argc, char *argv[])
+int main(int argc, char* argv[])
{
using namespace phosphor::logging;
@@ -105,10 +104,8 @@ int main(int argc, char *argv[])
sdbusplus::server::manager::manager objManager(bus, OBJ_NETWORK);
bus.request_name(BUSNAME_NETWORK);
- phosphor::network::manager =
- std::make_unique<phosphor::network::Manager>(bus,
- OBJ_NETWORK,
- NETWORK_CONF_DIR);
+ phosphor::network::manager = std::make_unique<phosphor::network::Manager>(
+ bus, OBJ_NETWORK, NETWORK_CONF_DIR);
// create the default network files if the network file
// is not there for any interface.
@@ -130,7 +127,7 @@ int main(int argc, char *argv[])
// the network which creates the network objects
}
- //RtnetLink socket
+ // RtnetLink socket
phosphor::Descriptor smartSock;
createNetLinkSocket(smartSock);
@@ -138,9 +135,10 @@ int main(int argc, char *argv[])
phosphor::network::rtnetlink::Server svr(eventPtr, smartSock);
// DNS entry handler
- phosphor::network::inotify::Watch watch(eventPtr, DNS_ENTRY_FILE,
- std::bind(&phosphor::network::dns::updater::processDNSEntries,
- std::placeholders::_1));
+ phosphor::network::inotify::Watch watch(
+ eventPtr, DNS_ENTRY_FILE,
+ std::bind(&phosphor::network::dns::updater::processDNSEntries,
+ std::placeholders::_1));
// At this point, we have registered for the notifications for future
// events. However, if the file is already populated before this, then
@@ -150,4 +148,3 @@ int main(int argc, char *argv[])
sd_event_loop(eventPtr.get());
}
-
OpenPOWER on IntegriCloud