# Copyright (C) 2014 INRIA
#
# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation;
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
def __init__(self, ec, guid):
super(NS3BaseNode, self).__init__(ec, guid)
self._simulation = None
+ self._node_id = None
self._ipv4 = None
self._arp = None
self._mobility = None
if not self._simulation:
msg = "Node not connected to simulation"
self.error(msg)
- raise RuntimeError, msg
+ raise RuntimeError(msg)
return self._simulation
if not devices:
msg = "Node not connected to devices"
self.error(msg)
- raise RuntimeError, msg
+ raise RuntimeError(msg)
self._devices = devices
return self._devices
+ @property
+ def node_id(self):
+ return self._node_id
+
@property
def dceapplications(self):
if not self._dceapplications:
@property
def _rms_to_wait(self):
- rms = set()
- rms.add(self.simulation)
+ rms = set([self.simulation])
- ipv4 = self.ipv4
- if ipv4:
- rms.add(ipv4)
+ if self.ipv4:
+ rms.add(self.ipv4)
- arp = self.arp
- if arp:
- rms.add(arp)
+ if self.arp:
+ rms.add(self.arp)
- mobility = self.mobility
- if mobility:
- rms.add(mobility)
+ if self.mobility:
+ rms.add(self.mobility)
return rms
uuid_packet_socket_factory = self.simulation.create("PacketSocketFactory")
self.simulation.invoke(self.uuid, "AggregateObject", uuid_packet_socket_factory)
+ self._node_id = self.simulation.invoke(self.uuid, "GetId")
+
dceapplications = self.dceapplications
if dceapplications:
self._add_dce(dceapplications)
container_uuid = self.simulation.create("NodeContainer")
self.simulation.invoke(container_uuid, "Add", self.uuid)
- with dceapp.dce_manager_lock:
- self.simulation.invoke(dceapp.dce_manager_helper_uuid,
- "Install", container_uuid)
+
+ dce_helper = self.simulation.dce_helper
+
+ with dce_helper.dce_manager_lock:
+ dce_manager_uuid = dce_helper.dce_manager_uuid
+
+ self.simulation.invoke(dce_manager_uuid, "Install", container_uuid)