I am working on ns2.35 but i want to access a variable from a program connector.cc #include "packet.h" #include "connector.h"
int attacker = 0;
static class ConnectorClass : public TclClass {
to aodv.cc
#include <connector.h>
extern int attacker;
then
if (malicious == 1000){
printf("\nDROPD\n");
drop(p, DROP_RTR_ROUTE_LOOP);
}
printf("\nAttacker: %d\n", &attacker);
For example i declared a variable int attacker = 0; in connector.cc and i want to access this variable in aodv.cc How can i do that? I am not able to do so using the above code. I am using c++.
Thank you in advance :)