Adding dummy ns3 fd-net-device test
[nepi.git] / src / nepi / resources / ns3 / ns3pipechanel.py
index c74b24d..b9da520 100644 (file)
@@ -58,14 +58,9 @@ class NS3BasePipeChannel(NS3Base):
 
     def _instantiate_object(self):
         """ The pipe channel does not really exists as an ns-3 object.
-        Do nothing, just validate that the simulator is in real time
-        mode, otherwise it is not going to work.
+        Do nothing.
         """
-        mode = self.simulator.get("simulatorImplementationType")
-        if mode != "ns3::RealtimeSimulatorImpl":
-            msg = "The simulation must run in real time!!"
-                self.error(msg)
-                raise RuntimeError, msg
+        pass
 
     def _connect_object(self):
         dev1 = self.devices[0]
@@ -73,17 +68,15 @@ class NS3BasePipeChannel(NS3Base):
 
         if dev1.uuid not in self.connected and dev2.uuid not in self.connected:
             (s0, s1) = socket.socketpair(socket.AF_UNIX, socket.SOCK_STREAM, 0)
-            self._send_fd(dev1, s0)
-            self._send_fd(dev2, s1)
+            
+            dev1.send_fd(s0)
 
-    def _send_fd(self, dev, fd):
-        import passfd
-        
-        address = self.simulation.invoke(dev.uuid, "recvFD")
-        sock = socket.socket(socket.AF_UNIX, socket.SOCK_DGRAM)
-        sock.connect(address)
-        passfd.sendfd(sock, fd, '0')
+            self._connected.add(dev1.uuid)
+            dev1._connected.add(self.uuid)
+
+            dev2.send_fd(s1)
+
+            self._connected.add(dev2.uuid)
+            dev2._connected.add(self.uuid)
 
-        self._connected.add(dev.uuid)
-        dev._connected.add(self.uuid)