2 # NEPI, a framework to manage network experiments
\r
3 # Copyright (C) 2013 INRIA
\r
5 # This program is free software: you can redistribute it and/or modify
\r
6 # it under the terms of the GNU General Public License version 2 as
\r
7 # published by the Free Software Foundation;
\r
9 # This program is distributed in the hope that it will be useful,
\r
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
\r
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
\r
12 # GNU General Public License for more details.
\r
14 # You should have received a copy of the GNU General Public License
\r
15 # along with this program. If not, see <http://www.gnu.org/licenses/>.
\r
17 # Author: Damien Saucez <damien.saucez@inria.fr>
\r
18 # Alina Quereilhac <alina.quereilhac@inria.fr>
\r
20 from experiment import Experiment
\r
22 class ExperimentInterconnected(Experiment):
\r
23 def __init__(self, ec, node, nb_nodes, real_time = True):
\r
24 super(ExperimentInterconnected, self).__init__(ec, node, nb_nodes, real_time)
\r
25 self.interconnected = False
\r
28 def add_fdnetdevice(self, ip, prefix, nsnode = None):
\r
31 # only one FD device allowed
\r
33 raise Exception("A FD device is already setup")
\r
35 # Attach the FD device to the access point by default
\r
37 nsnode = self.nsnodes[0]
\r
39 # Create the FD device
\r
40 self.fddev = self.ec.register_resource("ns3::FdNetDevice")
\r
41 self.ec.set(self.fddev, "ip", ip)
\r
42 self.ec.set(self.fddev, "prefix", prefix)
\r
44 # attach it to the simulated node
\r
45 self.ec.register_connection(nsnode, self.fddev)
\r