[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[ns] how to get nextHop_ in .cc




Hello,

How could I get the nextHop_ id to some destination?
Would you like to tell me? Thanks.

Lee

ps. I tried the following, failed.

in .cc of some agent implementation,

  Tcl & tcl = Tcl::instance();
  tcl.evalf("[[%s set node_] rtObject?] nextHop? %d", name(), 11);

  cout << "Nexthop to node 11 is: " << tcl.result() << "\n"; 


in .tcl file there 
$ns rtproto DV

and there is node 11

I got the following message,
ns: [[_o507 set node_] rtObject?] nextHop? 11: can't read "nextHop_(11)":
no such element in array
    (Object set line 1)
    invoked from within
"$self set nextHop_($dest)"
    (procedure "_o522" line 4)
    (rtObject nextHop? line 4)
    invoked from within
"[[_o507 set node_] rtObject?] nextHop? 11"