Hello All,
            I am using BeeAdHoc routing protocol have activated the
promiscuous mode,so that all the packets from the mac layer are transferred
to protocol layer.Now that I have information of all the packets,what I want
to do is that is that store the information of the packets not destined for
the local node and then return them to the mac layer for normal working
.Following is the change i had made in mac802.11.cc to upgrade all the
packets to protocol layer.

/*
         * Address Filtering
         */
        if(dst != (u_int32_t)index_ && dst != MAC_BROADCAST) {
        //if(dst != (u_int32_t)index_ || dst != MAC_BROADCAST) {
                /*
                 *  We don't want to log this event, so we just free
                 *  the packet instead of calling the drop routine.
                 */
                //recvDATA(pktRx_);
                printf("    Here I am................: \n");
                //discard(pktRx_, "---");//original working of the mac802.11.cc
                uptarget_->recv(pktRx_, (Handler*) 0);// change made by me for
transferring packets to protocol layer
                goto done;
        }



"""so what code shall be written in order to save the info of the neighbours
and then returning the packets back to mac layer.Following is the function
where all the packets are received.


void Beeadhoc::recv(Packet* p, Handler* h) {

        hdr_ip* iph = HDR_IP(p);
        hdr_cmn* cmh = HDR_CMN(p);
        hdr_beeadhoc* bhh = HDR_BEEADHOC(p);

        int src = Address::instance().get_nodeaddr(iph->saddr());

        // Must be a packet I'm originating...
        if(src == localaddress && cmh->num_forwards() == 0) {
        
                iph->ttl_ = IP_DEF_TTL;
                handleFromApp(p);
        }
        else {
                //if((bhh->type() != 1) && (bhh->type() != 2)) {
                //      return;
                //}

                  if(){

                         ''''''''''''add something here to save the info
from the packets not destines for the present node'''''''''''''''''''


                      return;
                       }
                switch(bhh->type()) {
                        case SCOUT: handleScout(p); break;
                        case FORAGER: handleForager(p); 
d("versuch"<<bhh->type()); break;
                }
        }
}
-- 
View this message in context: 
http://old.nabble.com/storing-the-routing-info-of-the-neighbour-nodes-on-the-local-node-i-tp30788185p30788185.html
Sent from the ns-users mailing list archive at Nabble.com.

Reply via email to