I'm trying to calculate how many route repair attempt have been made during simulation. I try to put a counter but it's unsuccessful (looks like basic C++ but i failed). The source code is aodv.cc
this is my modification: #ifdef AODV_LOCAL_REPAIR /* if the broken link is closer to the dest than source, attempt a local repair. Otherwise, bring down the route. */ int rtrepair = 0; if (ch->num_forwards() > rt->rt_hops) { local_rt_repair(rt, p); // local repair rtrepair++; // retrieve all the packets in the ifq using this link, // queue the packets for which local repair is done, //return; } else { printf("Number of Attempt route repair : %d \n",rtrepair); } return; #endif // LOCAL REPAIR i define 'rtrepair' parameter, and if network attempt to do local repair, it will justt increment it. Anything wrong with my code? can i get number of route repair attempt in trace file? if yes, how? appreciate all the ns2's sifu out there help.... -------------------------------------------------------------------------------------------- UNIVERSITY OF MALAYA - " The Leader in Research & Innovation " 'This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error, please notify the system manager. Please note that any views or opinions presented in this email are solely those of the author and do not necessarily represent those of the University. Finally, the recipient should check this email and any attachments for the presence of viruses. The University accepts no liability for any damage caused by any virus transmitted by this email.'