summaryrefslogtreecommitdiffstats
path: root/network/netmgr/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'network/netmgr/main.cpp')
-rw-r--r--network/netmgr/main.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/network/netmgr/main.cpp b/network/netmgr/main.cpp
index c6e20bc..e4b43f6 100644
--- a/network/netmgr/main.cpp
+++ b/network/netmgr/main.cpp
@@ -20,12 +20,15 @@
#include "log.h"
#include "monitor.h"
#include "poller.h"
+#include "wifi_forwarder.h"
#include <arpa/inet.h>
#include <netinet/in.h>
#include <functional>
+static const char kWifiMonitorInterface[] = "hwsim0";
+
static void usage(const char* name) {
LOGE("Usage: %s --if-prefix <prefix> --network <ip/mask>", name);
LOGE(" <prefix> indicates the name of network interfaces to configure.");
@@ -131,9 +134,17 @@ int main(int argc, char* argv[]) {
WifiCommand wifiCommand;
commander.registerCommand("wifi", &wifiCommand);
+ WifiForwarder forwarder(kWifiMonitorInterface);
+ res = forwarder.init();
+ if (!res) {
+ LOGE("%s", res.c_str());
+ return 1;
+ }
+
Poller poller;
poller.addPollable(&monitor);
poller.addPollable(&commander);
+ poller.addPollable(&forwarder);
return poller.run();
}