HELLO,
I want to reach a member variable of the class AODV and to modify it in
MAC_802-11.
For this reason I get instance of Routing Agent AODV as explain in website
Veiled how I recovered this variable:
In file mac_802-11.h I added:
#include "aodv/aodv.h"
............
In file mac_802-11.cc I added:
void Mac802_11::recvDATA(Packet *p)
{
.............
AODV* aodvagent;
int i= index_;
char command[256];
sprintf(command, "foreach aodvagent [Agent/AODV info instances]\
{\nif { [$aodvagent id] == %d} {\nset i $aodvagent}}\nset t $i\n", i);
Tcl& tcl = Tcl::instance();
tcl.eval(command);
const char* ref = tcl.result();
aodvagent = (AODV*)tcl.lookup(ref);
.
}
but when I execute the script tcl, I found
ns: foreach aodvagent [Agent/AODV info instances]{
if { [$aodvagent id] == 5} {
set i $aodvagent}}
set t $i
: wrong # args: should be "foreach varList list ?varList list ...? command"
while executing
"foreach aodvagent [Agent/AODV info instances]{"
and the execution stopped.
Please Where is the problem.
Thank you in advance
_________________________________________________________________
Personnalisez votre Messenger avec Live.com
http://www.windowslive.fr/livecom/