You need to pass node id as an argument to this method.  e.g. in aodv.cc  withing rt_resolve() method,   rt_print(0);   This will print node 0's routing table at that time with file name as node_0 .   void AODV::rt_print(nsaddr_t node_id) {     FILE * tmpFile;     char tmpFileName[50] = "node_";     char tmp[10] = "";     sprintf(tmp,"%d",node_id);     strcat(tmpFileName,tmp);        tmpFile = fopen(tmpFileName, "w");     aodv_rt_entry *rt;        for (rt = rtable.head(); rt; rt = rt->rt_link.le_next)     {         fprintf(             tmpFile,             "Node Id:%i Current time:%.4lf Destination:%i Next hop:%i No. of hops:%i Seq. No.:%i Route expire:%f Flags:%.4lf %d \n", ...
NS-2 development in linux environment using Eclipse.