Tunnel between 2 ns-3s in remote PL hosts
[nepi.git] / src / nepi / resources / linux / ns3 / fdudptunnel.py
similarity index 95%
rename from src/nepi/resources/linux/ns3/p2pfdudptunnel.py
rename to src/nepi/resources/linux/ns3/fdudptunnel.py
index 72662b1..7183325 100644 (file)
@@ -76,10 +76,11 @@ class LinuxNs3FdUdpTunnel(LinuxUdpTunnel):
         self._fd1node = None
         self._fd2 = None
         self._fd2node = None
+        self._pi = False
 
     def log_message(self, msg):
         self.get_endpoints()
-        return " guid %d - fd-udptunnel %s - %s - %s " % (self.guid, 
+        return " guid %d - %s - %s - %s " % (self.guid, 
                 self.node1.get("hostname"), 
                 self.node2.get("hostname"), 
                 msg)
@@ -116,6 +117,10 @@ class LinuxNs3FdUdpTunnel(LinuxUdpTunnel):
 
         return [self._fd1, self._fd2]
 
+    @property
+    def pi(self):
+        return self._pi
+
     @property
     def endpoint1(self):
         return self._fd1
@@ -155,7 +160,7 @@ class LinuxNs3FdUdpTunnel(LinuxUdpTunnel):
         linux_passfd = os.path.join(os.path.dirname(__file__),
                 "..",
                 "scripts",
-                "linux-ns3-fd-udp-connect.py")
+                "fd-udp-connect.py")
 
         scripts.append(linux_passfd)
        
@@ -337,15 +342,18 @@ class LinuxNs3FdUdpTunnel(LinuxUdpTunnel):
         
         command = [""]
         command.append("PYTHONPATH=$PYTHONPATH:${SRC}")
-        command.append("python ${SRC}/linux-ns3-fd-udp-connect.py")
+        command.append("python ${SRC}/fd-udp-connect.py")
         command.append("-a %s" % address)
-        command.append("-p %s " % local_port_file)
-        command.append("-P %s " % remote_port_file)
-        command.append("-o %s " % local_ip)
-        command.append("-O %s " % remote_ip)
-        command.append("-R %s " % ret_file)
+        command.append("-p %s" % local_port_file)
+        command.append("-P %s" % remote_port_file)
+        command.append("-o %s" % local_ip)
+        command.append("-O %s" % remote_ip)
+        command.append("-R %s" % ret_file)
+        command.append("-t %s" % "IFF_TAP")
+        if self.pi:
+            command.append("-n")
         if cipher:
-            command.append("-c %s " % cipher)
+            command.append("-c %s" % cipher)
         if cipher_key:
             command.append("-k %s " % cipher_key)
         if txqueuelen: