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

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

?? channel.cc

?? 用C++編寫的GPRS協議棧源代碼
?? CC
字號:
/* -*-	Mode:C++; c-basic-offset:8; tab-width:8; indent-tabs-mode:t -*- *//* * Copyright (c) 1996 Regents of the University of California. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright *    notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright *    notice, this list of conditions and the following disclaimer in the *    documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software *    must display the following acknowledgement: *	This product includes software developed by the Computer Systems *	Engineering Group at Lawrence Berkeley Laboratory and the Daedalus *	research group at UC Berkeley. * 4. Neither the name of the University nor of the Laboratory may be used *    to endorse or promote products derived from this software without *    specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * Contributed by Giao Nguyen, http://daedalus.cs.berkeley.edu/~gnguyen */#ifndef lintstatic const char rcsid[] =    "@(#) $Header: /nfs/jade/vint/CVSROOT/ns-2/channel.cc,v 1.36 2000/08/30 00:10:45 haoboy Exp $ (UCB)";#endif//#include "template.h"#include <float.h>#include "trace.h"#include "delay.h"#include "object.h"#include "packet.h"#include "mac.h"#include "channel.h"#include "lib/bsd-list.h"#include "phy.h"#include "wireless-phy.h"#include "mobilenode.h"#include "ip.h"#include "dsr/hdr_sr.h"#include "gridkeeper.h"static class ChannelClass : public TclClass {public:	ChannelClass() : TclClass("Channel") {}	TclObject* create(int, const char*const*) {		return (new Channel);	}} class_channel;/*static class DuplexChannelClass : public TclClass {public:	DuplexChannelClass() : TclClass("Channel/Duplex") {}	TclObject* create(int, const char*const*) {		return (new DuplexChannel);	}	} class_channel_duplex; */static class WirelessChannelClass : public TclClass {public:        WirelessChannelClass() : TclClass("Channel/WirelessChannel") {}        TclObject* create(int, const char*const*) {                return (new WirelessChannel);        }} class_Wireless_channel;/* ==================================================================   NS Initialization Functions   =================================================================*/static int ChannelIndex = 0;Channel::Channel() : TclObject(){	index_ = ChannelIndex++;	LIST_INIT(&ifhead_);	bind_time("delay_", &delay_);}int Channel::command(int argc, const char*const* argv){		if (argc == 3) {		TclObject *obj;		if( (obj = TclObject::lookup(argv[2])) == 0) {			fprintf(stderr, "%s lookup failed\n", argv[1]);			return TCL_ERROR;		}		if (strcmp(argv[1], "trace-target") == 0) {			trace_ = (Trace*) obj;			return (TCL_OK);		}		else if(strcmp(argv[1], "addif") == 0) {			((Phy*) obj)->insertchnl(&ifhead_);			((Phy*) obj)->setchnl(this);			return TCL_OK;		}		// add interface for grid_keeper_		/*else if(strncasecmp(argv[1], "grid_keeper", 5) == 0) {			grid_keeper_ = (GridKeeper*)obj;			return TCL_OK;			}*/	} else if (argc == 2) {		Tcl& tcl = Tcl::instance();		if (strcmp(argv[1], "trace-target") == 0) {			tcl.resultf("%s", trace_->name());			return (TCL_OK);		}		else if(strcmp(argv[1], "id") == 0) {			tcl.resultf("%d", index_);			return TCL_OK;		}	}	return TclObject::command(argc, argv);}void Channel::recv(Packet* p, Handler* h){//      Scheduler& s = Scheduler::instance();// 	hdr_cmn::access(p)->direction() = hdr_cmn::UP;// 	s.schedule(target_, p, txstop_ + delay_ - s.clock());	sendUp(p, (Phy*)h);}voidChannel::sendUp(Packet* p, Phy *tifp){	Scheduler &s = Scheduler::instance();	Phy *rifp = ifhead_.lh_first;	Node *tnode = tifp->node();	Node *rnode = 0;	Packet *newp;	double propdelay = 0.0;	struct hdr_cmn *hdr = HDR_CMN(p);		hdr->direction() = hdr_cmn::UP;	        if (GridKeeper::instance()) {	    int i;	    GridKeeper* gk = GridKeeper::instance();	    int size = gk->size_; 	    	    MobileNode **outlist = new MobileNode *[size];	        	    int out_index = gk->get_neighbors((MobileNode*)tnode,						         outlist);	    for (i=0; i < out_index; i ++) {				  newp = p->copy();		  rnode = outlist[i];		  propdelay = get_pdelay(tnode, rnode);		  rifp = (rnode->ifhead()).lh_first; 		  for(; rifp; rifp = rifp->nextnode()){			  if (rifp->channel() == this){				 s.schedule(rifp, newp, propdelay); 				 break;			  }		  } 	    }	    delete [] outlist; 	} else {	    for( ; rifp; rifp = rifp->nextchnl()) {		rnode = rifp->node();		if(rnode == tnode)			continue;		/*		 * Each node needs to get their own copy of this packet.		 * Since collisions occur at the receiver, we can have		 * two nodes canceling and freeing the *same* simulation		 * event.		 *		 */		newp = p->copy();		propdelay = get_pdelay(tnode, rnode);				/*		 * Each node on the channel receives a copy of the		 * packet.  The propagation delay determines exactly		 * when the receiver's interface detects the first		 * bit of this packet.		 */		s.schedule(rifp, newp, propdelay);	    }	}	Packet::free(p);}double Channel::get_pdelay(Node* /*tnode*/, Node* /*rnode*/){	// Dummy function	return delay_;}voidChannel::dump(void){	Phy *n;		fprintf(stdout, "Network Interface List\n"); 	for(n = ifhead_.lh_first; n; n = n->nextchnl() )		n->dump();	fprintf(stdout, "--------------------------------------------------\n");}// Wireless extensionsclass MobileNode;WirelessChannel::WirelessChannel(void) : Channel() {}	doubleWirelessChannel::get_pdelay(Node* tnode, Node* rnode){  //	printf ("<%d>,  pkt on  wireless channel  \n", index_);	// Scheduler	&s = Scheduler::instance();	MobileNode* tmnode = (MobileNode*)tnode;	MobileNode* rmnode = (MobileNode*)rnode;	double propdelay = 0;	//	propdelay = tmnode->propdelay(rmnode); //	printf("<%d>, propdelay = %f \n", index_, propdelay);//	assert(propdelay >= 0.0); //	if (propdelay == 0.0) {		/* if the propdelay is 0 b/c two nodes are on top of 		   each other, move them slightly apart -dam 7/28/98 *///		propdelay = 2 * DBL_EPSILON;//		printf ("propdelay 0: %d->%d \n",//			tmnode->address(), rmnode->address());//	} - rj i want prop delay == 0 to synchronise the Tx and RX timers//	for GPRS	return propdelay;}	// send()://  The packet occupies the channel for the transmission time, txtime//  If collision occur (>1 pkts overlap), corrupt all pkts involved//	by setting the error bit or discard them// int Channel::send(Packet* p, Phy *tifp)// {// 	// without collision, return 0// 	Scheduler& s = Scheduler::instance();// 	double now = s.clock();// 	// busy = time when the channel are still busy with earlier tx// 	double busy = max(txstop_, cwstop_);// 	// txstop = when the channel is no longer busy from this tx// 	txstop_ = max(busy, now + txtime);// 	// now < busy => collision// 	//	mark the pkt error bit, EF_COLLISION// 	//	drop if there is a drop target, drop_// 	if (now < busy) {// 		// if still transmit earlier packet, pkt_, then corrupt it// 		if (pkt_ && pkt_->time_ > now) {// 			hdr_cmn::access(pkt_)->error() |= EF_COLLISION;// 			if (drop_) {// 				s.cancel(pkt_);// 				drop(pkt_);// 				pkt_ = 0;// 			}// 		}// 		// corrupts the current packet p, and drop if drop_ exists// 		hdr_cmn::access(p)->error() |= EF_COLLISION;// 		if (drop_) {// 			drop(p);// 			return 1;// 		}// 	}// 	// if p was not dropped, call recv() or hand it to trace_ if present// 	pkt_ = p;// 	trace_ ? trace_->recv(p, 0) : recv(p, 0);// 	return 0;// }// contention()://  The MAC calls this Channel::contention() to enter contention period//  It determines when the contention window is over, cwstop_,//	and schedule a callback to the MAC for the actual send()// void Channel::contention(Packet* p, Handler* h)// {// 	Scheduler& s = Scheduler::instance();// 	double now = s.clock();// 	if (now > cwstop_) {// 		cwstop_ = now + delay_;// 		numtx_ = 0;// 	}// 	numtx_++;// 	s.schedule(h, p, cwstop_ - now);// }// jam()://  Jam the channel for a period txtime//  Some MAC protocols use this to let other MAC detect collisions// int Channel::jam(double txtime)// {// 	// without collision, return 0// 	double now = Scheduler::instance().clock();// 	if (txstop_ > now) {// 		txstop_ = max(txstop_, now + txtime);// 		return 1;// 	}// 	txstop_ = now + txtime;// 	return (now < cwstop_);// }// int DuplexChannel::send(Packet* p, double txtime)// {// 	double now = Scheduler::instance().clock();// 	txstop_ = now + txtime;// 	trace_ ? trace_->recv(p, 0) : recv(p, 0);// 	return 0;// }// void DuplexChannel::contention(Packet* p, Handler* h)// {// 	Scheduler::instance().schedule(h, p, delay_);// 	numtx_ = 1;// }

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久麻豆一区二区| 日韩理论片在线| 99久久伊人网影院| 一区二区三区中文在线| 国产精品另类一区| 欧美另类高清zo欧美| 91一区二区在线| 色悠悠亚洲一区二区| 99精品久久只有精品| 日韩精品专区在线影院重磅| 欧美精品一二三区| 亚洲欧洲精品一区二区精品久久久 | 亚洲日本一区二区| 激情文学综合插| 国产电影一区在线| av在线不卡免费看| 久久综合av免费| 国产精品色噜噜| 国产精品一区二区在线播放| 99精品久久久久久| 久久精品亚洲一区二区三区浴池| 国产午夜三级一区二区三| 免费成人av在线| 国产精品香蕉一区二区三区| 91精品国产综合久久精品性色| 精品国产乱码久久久久久闺蜜| 日本一区二区高清| 亚洲一级二级三级| 久久精品国产成人一区二区三区 | 成人三级伦理片| 欧美亚洲丝袜传媒另类| 7777精品久久久大香线蕉 | 欧美写真视频网站| 一区二区三区在线观看网站| 91视视频在线观看入口直接观看www | 国产精品一区二区不卡| 久久久久久久久一| 高清shemale亚洲人妖| 欧美色成人综合| 国产欧美日韩在线视频| 亚洲高清久久久| 国产成人免费在线观看不卡| 亚洲国产精品成人综合 | 国产精品成人在线观看| aaa国产一区| 亚洲另类中文字| 国产电影精品久久禁18| 国产精品毛片久久久久久久| 91老师国产黑色丝袜在线| 一区二区三区四区激情| 欧美视频一区二| 极品美女销魂一区二区三区| 欧美日韩电影在线播放| 一二三四区精品视频| 51午夜精品国产| 国产69精品一区二区亚洲孕妇| 国产精品三级电影| 欧美日高清视频| 高清视频一区二区| 亚洲国产精品欧美一二99| 日韩视频在线永久播放| 亚洲一二三四在线观看| 日韩一区二区三区av| 丁香六月综合激情| 亚洲国产精品久久艾草纯爱| 精品国产乱码久久久久久牛牛| 成人av资源在线| 久久久久久麻豆| 欧美在线小视频| 亚洲黄色尤物视频| 精品美女在线观看| 久久99精品一区二区三区| 国产精品久久网站| 欧美一区国产二区| 天堂av在线一区| 色综合久久中文字幕| 久久成人18免费观看| 国产精品久久久久久久裸模| 欧美肥妇毛茸茸| 北条麻妃国产九九精品视频| 日韩在线a电影| 亚洲人成亚洲人成在线观看图片| 成人白浆超碰人人人人| 亚洲一区二区av电影| 中文字幕av不卡| 日韩精品一区二区三区swag| 欧美性色综合网| av不卡一区二区三区| 国产美女一区二区| 久久久国产精品午夜一区ai换脸| 欧美三级蜜桃2在线观看| 成人一级片在线观看| 国内精品伊人久久久久av影院| 亚洲va韩国va欧美va| 欧美剧情电影在线观看完整版免费励志电影| 极品瑜伽女神91| 日韩福利视频导航| 久久色在线观看| 日韩欧美在线影院| 欧美丰满少妇xxxbbb| 欧美日韩久久久一区| 色视频一区二区| 91在线精品秘密一区二区| 国产福利一区二区三区视频| 精品午夜久久福利影院| 美女视频网站久久| 国产亚洲欧美一级| 久久久国产综合精品女国产盗摄| 精品少妇一区二区三区免费观看| 91精品麻豆日日躁夜夜躁| 欧美日韩中文字幕一区| 欧洲亚洲精品在线| 欧美午夜精品电影| 精品视频999| 欧美高清激情brazzers| 91精品国产一区二区三区香蕉| 欧美高清视频www夜色资源网| 欧美夫妻性生活| 91精品麻豆日日躁夜夜躁| 日韩一区二区在线免费观看| 欧美一卡二卡在线观看| 精品国免费一区二区三区| 精品999久久久| 欧美国产精品久久| 亚洲六月丁香色婷婷综合久久 | 久久69国产一区二区蜜臀| 日本系列欧美系列| 激情综合网激情| 成人性视频免费网站| 波多野结衣亚洲一区| 97se狠狠狠综合亚洲狠狠| 在线观看欧美黄色| 91精品国产欧美一区二区| 精品国产伦一区二区三区免费| 久久久久久影视| 一区二区三区四区精品在线视频| 亚洲一区免费在线观看| 日韩电影在线免费| 国产精品亚洲一区二区三区妖精| 成人福利视频网站| 欧美喷潮久久久xxxxx| 久久蜜桃av一区精品变态类天堂| 中文一区二区完整视频在线观看| 亚洲日本乱码在线观看| 天天综合网 天天综合色| 亚洲欧洲制服丝袜| 日本欧美肥老太交大片| 国产在线观看一区二区| 99国产精品视频免费观看| 欧美日韩综合不卡| 国产亚洲一区二区三区| 亚洲一区二区欧美日韩| 国产精品资源在线观看| 在线视频你懂得一区二区三区| 欧美电影免费观看高清完整版在线 | 亚洲国产综合色| 黑人精品欧美一区二区蜜桃| 成人福利视频在线看| 欧美肥妇bbw| 亚洲三级小视频| 美女视频黄久久| 91在线视频免费91| 欧美va在线播放| 亚洲精品国久久99热| 国产另类ts人妖一区二区| 欧美亚洲国产一区二区三区va| 久久综合九色欧美综合狠狠| 亚洲国产va精品久久久不卡综合| 一本色道久久综合狠狠躁的推荐| 在线播放/欧美激情| 亚洲丝袜自拍清纯另类| 国产一区二区三区四区在线观看 | 日韩一区二区在线看| 亚洲天堂成人网| 国产精品99久| 日韩欧美一区二区免费| 亚洲成人综合网站| 91蝌蚪porny成人天涯| 久久久久久一级片| 麻豆91在线播放免费| 欧美日韩一级黄| 一区二区在线看| 成人app在线| 欧美国产精品劲爆| 国产传媒久久文化传媒| www欧美成人18+| 另类小说图片综合网| 6080亚洲精品一区二区| 亚洲成a人v欧美综合天堂| 日本黄色一区二区| 在线成人小视频| 亚洲成人自拍偷拍| 欧美日韩在线不卡| 亚洲国产精品久久人人爱蜜臀| 一本大道久久a久久精品综合| 国产精品乱人伦中文| 成人午夜视频在线| 国产精品女人毛片| 97成人超碰视| 亚洲综合网站在线观看|