first thanks for your support
aodv.h
protected:
int command(int, const char *const *);
int initialized() { return 1 && target_; }
bool malicious; // add by gebeyehu
aodv.cc
int
AODV::command(int argc, const char*const* argv) {
if(argc == 2) {
Tcl& tcl = Tcl::instance();
if(strncasecmp(argv[1], "hacker", 6) == 0) {// add by Gebeyehu ++++++++++++++++++++++++
malicious = true; // / add by Gebeyehu ++++++++++++++++++++++++
return TCL_OK; /// add by Gebeyehu ++++++++++++++++++++++++
}
AODV::AODV(nsaddr_t id) : Agent(PT_AODV),
btimer(this), htimer(this), ntimer(this),
rtimer(this), lrtimer(this), rqueue() {
index = id;
seqno = 2;
bid = 1;
LIST_INIT(&nbhead);
LIST_INIT(&bihead);
logtarget = 0;
ifqueue = 0;
malicious = false; // add by gebeyehu ++++++++++++++++++++++++
}
ODV::rt_resolve(Packet *p) {
struct hdr_cmn *ch = HDR_CMN(p);
struct hdr_ip *ih = HDR_IP(p);
aodv_rt_entry *rt;
if (malicious == true ) {// add by gebeyehu ++++++++++++++++++++++++
drop(p, DROP_RTR_ROUTE_LOOP); // add by gebeyehu ++++++++++++++++++++++++
}