[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[ns] Re: nodeid from c++
> could one find a node's id with using some c++ method like we do
> in tcl by $node id .
I don't think this feature is available by default. But a small change
will enable you to do that.
The following is in ns-lib.tcl,
Simulator instproc node args {
....
set node [eval new [Simulator set node_factory_] $args]
set Node_([$node id]) $node
> #set the nodeid in c++ Node
> $node nodeid [$node id]
$node set ns_ $self
$self check-node-num
return $node
...
}
I will check this change in sometime soon, but till then you can do it
yourself, and recompile.
Now the nodeid can be accessed by node->nodeid(), this method is already
defined in the c++ code.
- ratul
ps: its a good idea to have subject for your mail, helps ppl in parsing
the long list of messages effectively.