On Nov 25, 6:24 pm, Dorice Diane Ngueguia <
doricedi...@gmail.com>
wrote:
> -given a certain node, to know wether the application installed on it
> is still running or not (note that the application installed on my node is a
> very small one, needing some few seconds to end and get stopped)
If your application is inherited from the generic Application at
least, you could simply create some sort of IsRunning() method that
would return that information. Or the runtime is statically known then
just check if Now() > Starttime+Runtime.
> -"unassign" the ipv4addresses allocated to the corresponding
> NetDeviceContainer (in such a way to be able to "reassign" those addresses
> later
> -delete the node, and corresponding NodeContainer, NetDeviceContainer
> and Ipv4InterfaceContainer
I have asked this myself. You can't delete nodes, or what's more
problematic, links after they have been created. You can "switch them
off" and make it appear as if they are not present (set interfaces
down and so on), but not totally delete. I have this problem myself
with dynamically arriving and leaving nodes - no objects can be
deleted.
However, almost anything can be manipulated. So, set links down to
the node and it's effectively removed from the network. You *can*
reassign IP addresses at will. Just use Ipv4::RemoveAddress, and then
assign a new one. Use Node->GetObject<Ipv4>()->RemoveAddress(x,y).
Anyway, if you just want to assign IP addresses out-of-band (not
implement e.g. a full-scale DHCP client/server), I'm not sure why
can't you just do a std::map<Ipv4Address, Node> to store what's
assigned where, or use whatever data structure suits you to keep the
track.