aodv
can u please explain me the function recv() in aodv.cc file--
the code is as follows-- void AODV::recv(Packet *p, Handler*) { struct hdr_cmn *ch = HDR_CMN(p); struct hdr_ip *ih = HDR_IP(p); assert(initialized()); //assert(p->incoming == 0); // XXXXX NOTE: use of incoming flag has been depracated; In order to track direction of pkt flow, direction_ in hdr_cmn is used instead. see packet.h for details. if(ch->ptype() == PT_AODV) { ih->ttl_ -= 1; recvAODV(p); return; } /* * Must be a packet I'm originating... */ if((ih->saddr() == index) && (ch->num_forwards() == 0)) { /* * Add the IP Header. * TCP adds the IP header too, so to avoid setting it twice, we check if * this packet is not a TCP or ACK segment. */ if (ch->ptype() != PT_TCP && ch->ptype() != PT_ACK) { ch->size() += IP_HDR_LEN; } // Added by Parag Dadhania && John Novatnack to handle broadcasting if ( (u_int32_t)ih->daddr() != IP_BROADCAST) { ih->ttl_ = NETWORK_DIAMETER; } } /* * I received a packet that I sent. Probably * a routing loop. */ else if(ih->saddr() == index) { drop(p, DROP_RTR_ROUTE_LOOP); return; } /* * Packet I'm forwarding... */ else { /* * Check the TTL. If it is zero, then discard. */ if(--ih->ttl_ == 0) { drop(p, DROP_RTR_TTL); return; } } if ( (u_int32_t)ih->daddr() != IP_BROADCAST) rt_resolve(p); else forward((aodv_rt_entry*) 0, p, NO_DELAY); } please give detailed explanation. please reply soon |
Quote:
The code is fairly clear and commented. What part of it isn't working? What error(s) are you getting?? Or is this a school project, and you want us to give you the answers? |
All times are GMT -5. The time now is 08:34 PM. |