[ns] Please help me: A problem when I get Instance of Routing Agent AODV????

2007-07-11 Thread etudiante usthb

HELLO,

I want to reach a memeber variable in aodv to modify in Mac.
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

_
Découvrez le Blog heroic Fantaisy d'Eragon! 
http://eragon-heroic-fantasy.spaces.live.com/



[ns] Please help me: A problem when I get Instance of Routing Agent AODV????

2007-07-11 Thread etudiante usthb

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/