Hello ns users,

I would like to access some information from the routing agent AODV in UDP
protocol so what I did is that I create a pointer from AODV called “myaodv”
 in aodv.h but I need to allocate the AODV class before using it so what I
did as the following in the command function :

else if(argc == 3) {

                                if (strcmp(argv[1], "add-aodv") == 0) {

                myaodv = (AODV*) TclObject::lookup(argv[2]);

                if(myaodv == 0)

                                                return TCL_ERROR;

                                return TCL_OK;

                                }//end of if

                }//end of else if argc == 3

So in order to access the value from aodv, I write : myaodv-> totaldrop; //
This is as an example to simplify

Now I need to do some calculation, however, when I try to assign the above
value to another variable I got segmentation fault!

What I have realized after searching that I need to add some code in the
tcl script for aodv initialization in order to call the above AODV
allocation but I don’t know what I should add.  I mean when I want to
exchange information between the mac layer and routing layer I should add
the following in the tcl script:

set rt ($i) [$ node_ ($ i) agent 255]

$rt ($i) add-mac [$ node_ ($ i) set mac_ (0)]

So what is the aodv objects that I should use instead of the above two
lines to establish the access path between the udp and the aodv, Can anyone
help me to solve this issue please?  Any other ideas or suggestions will be
appreciated.

Note: I am trying to have a cross layer between the udp and AODV routing
agent.


Thanks for ur help in advance.

Reply via email to