[ns] How to get a reference of a node from AODV?‏

2013-04-17 Thread jose nmrd





Hi everyone,
here is the problem, i have added some 
code to the class Node to do some computations, i'm modifying the 
protocol AODV where i have to use the computations added in the class 
Node, but after looking at the class AODV composition there is just the 
address of the Node, not the reference to the whole structure of the 
Node. so my question is how to get the reference of the node that the 
AODV agent is associated to so that i can access the attributes and 
functions and of course my added code of the class Node? if any one can 
help, thx in advance .
Xoce. 

FW: [ns] How to get a reference of a node from AODV?‏

2013-04-17 Thread jose nmrd





Hi Itishi and thanks for the reply,
i know i have to create objects to access them, but currently in the class 
AODV.cc there only one variable index of type nsaddr_t which represents the 
address of the node [nsaddr_tindex;// IP Address of 
this node] but i don't know how to get the whole structure of Node because with 
this variable index i can't access the attributes of the node. in other words 
how to access classes AODV.cc and Node.cc from one to another? just by making 
them friends? 
for example if i put: $ns node-config -adhocRouting AODV, 
if i have a node N0 i want to get access to it from the AODV attached to it. 
Thank you very much again.
Xoce.

Date: Thu, 18 Apr 2013 06:31:23 +0800
From: itish...@yahoo.com
Subject: Re: [ns] How to get a reference of a node from AODV?‏
To: jose-...@hotmail.com; ns-users@ISI.EDU

Hello Jose,

For getting access to the node attribut you have to play with node.cc inside 
common folder in ns-2.34.

It is basically how you access method of one class toanother in c++.

so you have two classes aodv.cc and node.cc

you have to create object of one of them to access methods and they have to be 
friend of each other.

I hope it will give you sufficient hint for your task.


Itishi


From: jose nmrd jose-...@hotmail.com

 To: ns-users@isi.edu ns-users@ISI.EDU 
 Sent: Wednesday, 17 April 2013 5:30 PM
 Subject: [ns] How to get a reference of a node from AODV?‏
   





Hi everyone,
here is the problem, i have added some 
code to the class Node to do some computations, i'm modifying the 
protocol AODV where i have to use the computations added in the class 
Node, but after looking at the class AODV composition there is just the 
address of the Node, not the reference to the whole structure of the 
Node. so my question is how to get the reference of the node that the 
AODV agent is associated to so that i can access the attributes and 
functions and of course my added code of the class Node? if any one can 
help, thx in advance
 .
Xoce.