: bharatvaj/forwarder

commit 994f0e19608bd29499ace141d1d1fa7bd459f803
parent c6d8ca20c2d06a0ff2d0eaf167e61419822a4f9e
Author: Bharatvaj H <bharatvajph@gmail.com>
Date: Thu, 7 Feb 2019 23:41:07 +0000

TC
3 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/forwarder/forwarder.cpp b/forwarder/forwarder.cpp
@@ -32,7 +32,7 @@ int main(int argc, char *argv[])
 {
   signal(SIGINT, exit_handler);
   //TODO get all wireless
-    l = new WiFi("enp0s20f0u8");
+    l = new WiFi("wlan0");
     r = new Console();
   //Wait for the initiators to connect
 

@@ -50,6 +50,7 @@ int main(int argc, char *argv[])
 
   Connector c = Connector(*l, *r);
   c.setOnPipeCreated([](Network &l, Network &r){
+    cout << "Pipe created" << endl;
     f = new Forwarder(l, r);
     f->start();
   });
diff --git a/forwarder/include/Connector.hpp b/forwarder/include/Connector.hpp
@@ -39,6 +39,7 @@ namespace wa {
     void start(){
       l->listen();
       r->listen();
+      cout << "Both listeninig" << endl;
     }
 
     void setOnPipeCreated(std::function<void(Network &l, Network &r)> listener){
diff --git a/forwarder/include/WiFi.hpp b/forwarder/include/WiFi.hpp
@@ -31,7 +31,7 @@ namespace wa {
     bool init() override {
       struct ifreq ifr = {0};
       bool uar = false; //up_and_running
-      strcpy( ifr.ifr_name, ifName.c_str() ); //FIXME allow client to customize
+      strcpy( ifr.ifr_name, ifName.c_str() );
       int fd = socket(AF_INET, SOCK_STREAM, 0);
       //evavaluate uar
       if( ioctl( fd, SIOCGIFFLAGS, &ifr ) != -1 )