亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? aodv.cc

?? 用于無線傳感器網絡按需距離向量路由協議仿真的aodv代碼
?? CC
?? 第 1 頁 / 共 3 頁
字號:
   rqueue.enque(p);   sendRequest(rt->rt_dst); } /*  *	A local repair is in progress. Buffer the packet.   */ else if (rt->rt_flags == RTF_IN_REPAIR) {   rqueue.enque(p); } /*  * I am trying to forward a packet for someone else to which  * I don't have a route.  */ else { Packet *rerr = Packet::alloc(); struct hdr_aodv_error *re = HDR_AODV_ERROR(rerr); /*   * For now, drop the packet and send error upstream.  * Now the route errors are broadcast to upstream  * neighbors - Mahesh 09/11/99  */	    assert (rt->rt_flags == RTF_DOWN);   re->DestCount = 0;   re->unreachable_dst[re->DestCount] = rt->rt_dst;   re->unreachable_dst_seqno[re->DestCount] = rt->rt_seqno;   re->DestCount += 1;#ifdef DEBUG   fprintf(stderr, "%s: sending RERR...\n", __FUNCTION__);#endif   sendError(rerr, false);   drop(p, DROP_RTR_NO_ROUTE); }}voidAODV::rt_purge() {aodv_rt_entry *rt, *rtn;double now = CURRENT_TIME;double delay = 0.0;Packet *p; for(rt = rtable.head(); rt; rt = rtn) {  // for each rt entry   rtn = rt->rt_link.le_next;   if ((rt->rt_flags == RTF_UP) && (rt->rt_expire < now)) {   // if a valid route has expired, purge all packets from    // send buffer and invalidate the route.                    	assert(rt->rt_hops != INFINITY2);     while((p = rqueue.deque(rt->rt_dst))) {#ifdef DEBUG       fprintf(stderr, "%s: calling drop()\n",                       __FUNCTION__);#endif // DEBUG       drop(p, DROP_RTR_NO_ROUTE);     }     rt->rt_seqno++;     assert (rt->rt_seqno%2);     rt_down(rt);   }   else if (rt->rt_flags == RTF_UP) {   // If the route is not expired,   // and there are packets in the sendbuffer waiting,   // forward them. This should not be needed, but this extra    // check does no harm.     assert(rt->rt_hops != INFINITY2);     while((p = rqueue.deque(rt->rt_dst))) {       forward (rt, p, delay);       delay += ARP_DELAY;     }   }    else if (rqueue.find(rt->rt_dst))   // If the route is down and    // if there is a packet for this destination waiting in   // the sendbuffer, then send out route request. sendRequest   // will check whether it is time to really send out request   // or not.   // This may not be crucial to do it here, as each generated    // packet will do a sendRequest anyway.     sendRequest(rt->rt_dst);    }}/*  Packet Reception Routines*/voidAODV::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  */   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;   } }// Added by Parag Dadhania && John Novatnack to handle broadcasting if ( (u_int32_t)ih->daddr() != IP_BROADCAST)   rt_resolve(p); else   forward((aodv_rt_entry*) 0, p, NO_DELAY);}voidAODV::recvAODV(Packet *p) { struct hdr_aodv *ah = HDR_AODV(p); assert(HDR_IP (p)->sport() == RT_PORT); assert(HDR_IP (p)->dport() == RT_PORT); /*  * Incoming Packets.  */ switch(ah->ah_type) { case AODVTYPE_RREQ:   recvRequest(p);   break; case AODVTYPE_RREP:   recvReply(p);   break; case AODVTYPE_RERR:   recvError(p);   break; case AODVTYPE_HELLO:   recvHello(p);   break;         default:   fprintf(stderr, "Invalid AODV type (%x)\n", ah->ah_type);   exit(1); }}voidAODV::recvRequest(Packet *p) {struct hdr_ip *ih = HDR_IP(p);struct hdr_aodv_request *rq = HDR_AODV_REQUEST(p);aodv_rt_entry *rt;  /*   * Drop if:   *      - I'm the source   *      - I recently heard this request.   */  if(rq->rq_src == index) {#ifdef DEBUG    fprintf(stderr, "%s: got my own REQUEST\n", __FUNCTION__);#endif // DEBUG    Packet::free(p);    return;  }  if (id_lookup(rq->rq_src, rq->rq_bcast_id)) {#ifdef DEBUG   fprintf(stderr, "%s: discarding request\n", __FUNCTION__);#endif // DEBUG    Packet::free(p);   return; } /*  * Cache the broadcast ID  */ id_insert(rq->rq_src, rq->rq_bcast_id); /*   * We are either going to forward the REQUEST or generate a  * REPLY. Before we do anything, we make sure that the REVERSE  * route is in the route table.  */ aodv_rt_entry *rt0; // rt0 is the reverse route       rt0 = rtable.rt_lookup(rq->rq_src);   if(rt0 == 0) { /* if not in the route table */   // create an entry for the reverse route.     rt0 = rtable.rt_add(rq->rq_src);   }     rt0->rt_expire = max(rt0->rt_expire, (CURRENT_TIME + REV_ROUTE_LIFE));   if ( (rq->rq_src_seqno > rt0->rt_seqno ) ||    	((rq->rq_src_seqno == rt0->rt_seqno) && 	 (rq->rq_hop_count < rt0->rt_hops)) ) {   // If we have a fresher seq no. or lesser #hops for the    // same seq no., update the rt entry. Else don't bother.rt_update(rt0, rq->rq_src_seqno, rq->rq_hop_count, ih->saddr(),     	       max(rt0->rt_expire, (CURRENT_TIME + REV_ROUTE_LIFE)) );     if (rt0->rt_req_timeout > 0.0) {     // Reset the soft state and      // Set expiry time to CURRENT_TIME + ACTIVE_ROUTE_TIMEOUT     // This is because route is used in the forward direction,     // but only sources get benefited by this change       rt0->rt_req_cnt = 0;       rt0->rt_req_timeout = 0.0;        rt0->rt_req_last_ttl = rq->rq_hop_count;       rt0->rt_expire = CURRENT_TIME + ACTIVE_ROUTE_TIMEOUT;     }     /* Find out whether any buffered packet can benefit from the       * reverse route.      * May need some change in the following code - Mahesh 09/11/99      */     assert (rt0->rt_flags == RTF_UP);     Packet *buffered_pkt;     while ((buffered_pkt = rqueue.deque(rt0->rt_dst))) {       if (rt0 && (rt0->rt_flags == RTF_UP)) {	assert(rt0->rt_hops != INFINITY2);         forward(rt0, buffered_pkt, NO_DELAY);       }     }   }    // End for putting reverse route in rt table /*  * We have taken care of the reverse route stuff.  * Now see whether we can send a route reply.   */ rt = rtable.rt_lookup(rq->rq_dst); // First check if I am the destination .. if(rq->rq_dst == index) {#ifdef DEBUG   fprintf(stderr, "%d - %s: destination sending reply\n",                   index, __FUNCTION__);#endif // DEBUG                  // Just to be safe, I use the max. Somebody may have   // incremented the dst seqno.   seqno = max(seqno, rq->rq_dst_seqno)+1;   if (seqno%2) seqno++;   sendReply(rq->rq_src,           // IP Destination             1,                    // Hop Count             index,                // Dest IP Address             seqno,                // Dest Sequence Num             MY_ROUTE_TIMEOUT,     // Lifetime             rq->rq_timestamp);    // timestamp    Packet::free(p); } // I am not the destination, but I may have a fresh enough route. else if (rt && (rt->rt_hops != INFINITY2) && 	  	(rt->rt_seqno >= rq->rq_dst_seqno) ) {   //assert (rt->rt_flags == RTF_UP);   assert(rq->rq_dst == rt->rt_dst);   //assert ((rt->rt_seqno%2) == 0);	// is the seqno even?   sendReply(rq->rq_src,             rt->rt_hops + 1,             rq->rq_dst,             rt->rt_seqno,	     (u_int32_t) (rt->rt_expire - CURRENT_TIME),	     //             rt->rt_expire - CURRENT_TIME,             rq->rq_timestamp);   // Insert nexthops to RREQ source and RREQ destination in the   // precursor lists of destination and source respectively   rt->pc_insert(rt0->rt_nexthop); // nexthop to RREQ source   rt0->pc_insert(rt->rt_nexthop); // nexthop to RREQ destination#ifdef RREQ_GRAT_RREP     sendReply(rq->rq_dst,             rq->rq_hop_count,             rq->rq_src,             rq->rq_src_seqno,	     (u_int32_t) (rt->rt_expire - CURRENT_TIME),	     //             rt->rt_expire - CURRENT_TIME,             rq->rq_timestamp);#endif   // TODO: send grat RREP to dst if G flag set in RREQ using rq->rq_src_seqno, rq->rq_hop_counT   // DONE: Included gratuitous replies to be sent as per IETF aodv draft specification. As of now, G flag has not been dynamically used and is always set or reset in aodv-packet.h --- Anant Utgikar, 09/16/02.	Packet::free(p); } /*  * Can't reply. So forward the  Route Request  */ else {   ih->saddr() = index;   ih->daddr() = IP_BROADCAST;   rq->rq_hop_count += 1;   // Maximum sequence number seen en route   if (rt) rq->rq_dst_seqno = max(rt->rt_seqno, rq->rq_dst_seqno);   forward((aodv_rt_entry*) 0, p, DELAY); }}voidAODV::recvReply(Packet *p) {//struct hdr_cmn *ch = HDR_CMN(p);struct hdr_ip *ih = HDR_IP(p);struct hdr_aodv_reply *rp = HDR_AODV_REPLY(p);aodv_rt_entry *rt;char suppress_reply = 0;double delay = 0.0;	#ifdef DEBUG fprintf(stderr, "%d - %s: received a REPLY\n", index, __FUNCTION__);#endif // DEBUG /*  *  Got a reply. So reset the "soft state" maintained for   *  route requests in the request table. We don't really have  *  have a separate request table. It is just a part of the  *  routing table itself.   */ // Note that rp_dst is the dest of the data packets, not the // the dest of the reply, which is the src of the data packets. rt = rtable.rt_lookup(rp->rp_dst);         /*  *  If I don't have a rt entry to this host... adding  */ if(rt == 0) {   rt = rtable.rt_add(rp->rp_dst); } /*  * Add a forward route table entry... here I am following   * Perkins-Royer AODV paper almost literally - SRD 5/99  */ if ( (rt->rt_seqno < rp->rp_dst_seqno) ||   // newer route       ((rt->rt_seqno == rp->rp_dst_seqno) &&         (rt->rt_hops > rp->rp_hop_count)) ) { // shorter or better route	  // Update the rt entry   rt_update(rt, rp->rp_dst_seqno, rp->rp_hop_count,         //******************************************************************   		//rp->rp_src, CURRENT_TIME + rp->rp_lifetime);           //Bug fix from Riadh		//******************************************************************	    ih->saddr(), CURRENT_TIME + rp->rp_lifetime);  // reset the soft state  rt->rt_req_cnt = 0;  rt->rt_req_timeout = 0.0;   rt->rt_req_last_ttl = rp->rp_hop_count;  if (ih->daddr() == index) { // If I am the original source  // Update the route discovery latency statistics  // rp->rp_timestamp is the time of request origination		    rt->rt_disc_latency[(unsigned char)rt->hist_indx] = (CURRENT_TIME - rp->rp_timestamp)                                         / (double) rp->rp_hop_count;    // increment indx for next time    rt->hist_indx = (rt->hist_indx + 1) % MAX_HISTORY;  }	  /*   * Send all packets queued in the sendbuffer destined for   * this destination.    * XXX - observe the "second" use of p.   */  Packet *buf_pkt;  while((buf_pkt = rqueue.deque(rt->rt_dst))) {    if(rt->rt_hops != INFINITY2) {          assert (rt->rt_flags == RTF_UP);    // Delay them a little to help ARP. Otherwise ARP     // may drop packets. -SRD 5/23/99      forward(rt, buf_pkt, delay);      delay += ARP_DELAY;    }  } } else {  suppress_reply = 1; } /*  * If reply is for me, discard it.  */if(ih->daddr() == index || suppress_reply) {   Packet::free(p); } /*  * Otherwise, forward the Route Reply.  */ else { // Find the rt entryaodv_rt_entry *rt0 = rtable.rt_lookup(ih->daddr());   // If the rt is up, forward   if(rt0 && (rt0->rt_hops != INFINITY2)) {        assert (rt0->rt_flags == RTF_UP);     rp->rp_hop_count += 1;     //***********************************************	 //rp->rp_src = index;                        //Bug fix from Riadh	 //***********************************************	 ih->saddr() = index;     forward(rt0, p, NO_DELAY);     // Insert the nexthop towards the RREQ source to      // the precursor list of the RREQ destination     rt->pc_insert(rt0->rt_nexthop); // nexthop to RREQ source        }   else {   // I don't know how to forward .. drop the reply. #ifdef DEBUG     fprintf(stderr, "%s: dropping Route Reply\n", __FUNCTION__);

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
av欧美精品.com| 国产suv一区二区三区88区| 国产精品色婷婷久久58| 精品盗摄一区二区三区| 国产成人免费9x9x人网站视频| 1区2区3区国产精品| 蜜臀av一区二区| 国产98色在线|日韩| 欧美综合一区二区三区| 一区二区三区成人| 国产91对白在线观看九色| 欧美曰成人黄网| 亚洲欧美日韩国产手机在线 | 人人精品人人爱| 亚洲人成精品久久久久| 久久久99久久| 国产综合成人久久大片91| 欧美成人video| 国产美女精品一区二区三区| 国产夜色精品一区二区av| 国产v日产∨综合v精品视频| 中文字幕在线一区| 欧美精品黑人性xxxx| 久久综合综合久久综合| 国产精品嫩草99a| 欧美午夜不卡视频| 国产尤物一区二区| 一区二区不卡在线播放 | 91免费精品国自产拍在线不卡| 亚洲视频香蕉人妖| 日韩一区二区三区高清免费看看| 精品中文字幕一区二区小辣椒| 国产精品毛片久久久久久久| 欧美日精品一区视频| 精品一区二区三区免费观看| **性色生活片久久毛片| 日韩色视频在线观看| av不卡免费电影| 麻豆久久久久久| 亚洲免费资源在线播放| 精品福利在线导航| 欧美综合一区二区| 成人精品一区二区三区四区| 五月天视频一区| 1024亚洲合集| 久久成人免费网站| 亚洲日本一区二区三区| 国产一区二区三区四| thepron国产精品| 国产欧美日韩另类视频免费观看| 欧美日韩欧美一区二区| 成人午夜视频免费看| 免费欧美高清视频| 亚洲综合在线电影| 国产精品伦理在线| 2020日本不卡一区二区视频| 欧美精品久久天天躁| 色拍拍在线精品视频8848| 国产福利一区二区三区在线视频| 天堂在线一区二区| 亚洲日本韩国一区| 国产精品―色哟哟| 久久久高清一区二区三区| 欧美一区二区视频在线观看| 日本电影欧美片| 99在线热播精品免费| 国产精品一区二区久久不卡 | 日本一区二区视频在线| 欧美一区二区久久| 欧美美女一区二区在线观看| 91麻豆国产在线观看| 丁香婷婷综合激情五月色| 精彩视频一区二区| 美国欧美日韩国产在线播放| 日韩专区一卡二卡| 午夜精品一区二区三区免费视频| 夜夜嗨av一区二区三区网页| 亚洲视频综合在线| 亚洲女人的天堂| 伊人婷婷欧美激情| 亚洲欧美日韩在线| 一区二区在线观看视频 | 久久久久99精品国产片| 久久影院午夜论| 久久精品男人的天堂| 国产欧美综合在线观看第十页| 久久精品人人做人人爽人人| 国产亚洲污的网站| 天涯成人国产亚洲精品一区av| 亚洲日本va在线观看| 日韩伦理av电影| 亚洲图片欧美色图| 日日摸夜夜添夜夜添精品视频| 日韩影院在线观看| 男女男精品网站| 麻豆一区二区三区| 国产成人免费av在线| av资源站一区| 欧美手机在线视频| 69久久99精品久久久久婷婷| 欧美成人猛片aaaaaaa| 国产亚洲欧洲一区高清在线观看| 亚洲国产电影在线观看| 亚洲欧美一区二区久久| 日韩精品成人一区二区在线| 国产真实乱对白精彩久久| 成人做爰69片免费看网站| 色婷婷综合久久久中文一区二区| 欧美另类z0zxhd电影| 精品国产sm最大网站免费看| 国产精品短视频| 午夜欧美2019年伦理| 国产精品系列在线播放| 色综合久久综合网| 欧美刺激脚交jootjob| 最近日韩中文字幕| 天天色天天操综合| 成人午夜精品在线| 欧美日韩在线三级| 国产欧美一区二区精品秋霞影院| 综合网在线视频| 麻豆精品视频在线观看免费| 国产精品99久久久久| 日本高清免费不卡视频| 欧美一二区视频| 亚洲精品国产第一综合99久久| 免费成人在线视频观看| 99久久精品免费精品国产| 日韩欧美一二三四区| 国产精品人成在线观看免费 | 91精彩视频在线| www.性欧美| 3d成人h动漫网站入口| 欧美国产精品久久| 日本网站在线观看一区二区三区| 成人avav在线| 久久综合九色综合97婷婷| 亚洲午夜久久久久久久久久久| 成人综合婷婷国产精品久久免费| 91麻豆精品国产91久久久久久| 亚洲色图欧美在线| 成人久久18免费网站麻豆| 欧美电视剧免费全集观看| 亚洲高清视频的网址| 99久久精品一区二区| 国产欧美一区二区三区鸳鸯浴| 看电影不卡的网站| 欧美女孩性生活视频| 亚洲激情综合网| av在线不卡网| 中文字幕av一区 二区| 久久99九九99精品| 欧美男女性生活在线直播观看| 欧美国产1区2区| 国产美女精品在线| 这里只有精品视频在线观看| 国产精品国产三级国产三级人妇| 国产一区在线精品| 欧美一区二区成人6969| 一区二区三区四区蜜桃 | 午夜亚洲国产au精品一区二区| 91农村精品一区二区在线| 久久久国产精品不卡| 日韩不卡免费视频| 日本电影欧美片| 亚洲色欲色欲www| 国产一区二三区好的| 91精品国产91综合久久蜜臀| 亚洲精品国产品国语在线app| 三级欧美在线一区| 欧美三级在线看| 亚洲激情图片小说视频| 成人app网站| 久久精品在线免费观看| 国产呦精品一区二区三区网站| 日韩精品一区二区在线| 午夜视频在线观看一区二区三区 | 国产精品嫩草久久久久| 国产福利一区二区三区视频在线| 久久久777精品电影网影网| 久久99精品国产.久久久久久| 欧美日韩在线直播| 无码av免费一区二区三区试看| 美女视频黄免费的久久 | 国产亚洲美州欧州综合国| 国内外精品视频| 日韩美女一区二区三区四区| 久99久精品视频免费观看| 日韩欧美一区二区视频| 蜜桃久久av一区| 亚洲国产精品激情在线观看| 国产成人超碰人人澡人人澡| 2023国产精品自拍| 国产精品一品视频| 一区二区三区中文免费| 在线欧美一区二区| 日韩中文字幕区一区有砖一区| 久久久一区二区三区捆绑**| 国产精品1区2区3区在线观看| 亚洲国产精品高清|