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

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

?? cmu-trace.cc

?? 這個市一個ns環境下的leach算法!大家可以多下在啊!我想要一個matlab環境下的概算法!
?? CC
?? 第 1 頁 / 共 3 頁
字號:
/* -*-	Mode:C++; c-basic-offset:8; tab-width:8; indent-tabs-mode:t -*- *//* * Copyright (c) 1997 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. * 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. * * Ported from CMU/Monarch's code, appropriate copyright applies. * nov'98 -Padma. * * $Header: /nfs/jade/vint/CVSROOT/ns-2/trace/cmu-trace.cc,v 1.78 2003/09/23 00:44:07 aditi Exp $ */#include <packet.h>#include <ip.h>#include <tcp.h>#include <sctp.h>#include <rtp.h>#include <arp.h>#include <dsr/hdr_sr.h>	// DSR#include <mac.h>#include <mac-802_11.h>#include <smac.h>#include <address.h>#include <tora/tora_packet.h> //TORA#include <imep/imep_spec.h>         // IMEP#include <aodv/aodv_packet.h> //AODV#include <cmu-trace.h>#include <mobilenode.h>#include <simulator.h>#include "diffusion/diff_header.h" // DIFFUSION -- Chalermek#ifdef MIT_uAMPS#include <mit/rca/rcagent.h>#endif//#define LOG_POSITION//extern char* pt_names[];static class CMUTraceClass : public TclClass {public:	CMUTraceClass() : TclClass("CMUTrace") { }	TclObject* create(int, const char*const* argv) {		return (new CMUTrace(argv[4], *argv[5]));	}} cmutrace_class;CMUTrace::CMUTrace(const char *s, char t) : Trace(t){	bzero(tracename, sizeof(tracename));	strncpy(tracename, s, MAX_ID_LEN);        if(strcmp(tracename, "RTR") == 0) {                tracetype = TR_ROUTER;        }	else if(strcmp(tracename, "TRP") == 0) {                tracetype = TR_ROUTER;        }        else if(strcmp(tracename, "MAC") == 0) {                tracetype = TR_MAC;        }        else if(strcmp(tracename, "IFQ") == 0) {                tracetype = TR_IFQ;        }        else if(strcmp(tracename, "AGT") == 0) {                tracetype = TR_AGENT;        }        else {                fprintf(stderr, "CMU Trace Initialized with invalid type\n");                exit(1);        }// change wrt Mike's code//	assert(type_ == DROP || type_ == SEND || type_ == RECV);	assert(type_ == DROP || type_ == SEND || type_ == RECV               || ((type_ == EOT) && (tracetype == TR_MAC)));	newtrace_ = 0;	for (int i=0 ; i < MAX_NODE ; i++) 		nodeColor[i] = 3 ;        node_ = 0;}voidCMUTrace::format_mac_common(Packet *p, const char *why, int offset){	struct hdr_cmn *ch = HDR_CMN(p);	struct hdr_ip *ih = HDR_IP(p);	struct hdr_mac802_11 *mh;	struct hdr_smac *sh;	char mactype[SMALL_LEN];	strcpy(mactype, Simulator::instance().macType());	if (strcmp (mactype, "Mac/SMAC") == 0)		sh = HDR_SMAC(p);	else		mh = HDR_MAC802_11(p);		double x = 0.0, y = 0.0, z = 0.0;       	char op = (char) type_;	Node* thisnode = Node::get_node_by_address(src_);	double energy = -1;	if (thisnode) {	    if (thisnode->energy_model()) {		    energy = thisnode->energy_model()->energy();	    }	}	// hack the IP address to convert pkt format to hostid format	// for now until port ids are removed from IP address. -Padma.	int src = Address::instance().get_nodeaddr(ih->saddr());	if(tracetype == TR_ROUTER && type_ == SEND) {		if(src_ != src)			op = FWRD;	}	// use tagged format if appropriate	if (pt_->tagged()) {		int next_hop = -1 ;		Node* nextnode = Node::get_node_by_address(ch->next_hop_);        	if (nextnode) next_hop = nextnode->nodeid(); 		node_->getLoc(&x, &y, &z);		if (op == DROP) op = 'd';		if (op == SEND) op = '+';		if (op == FWRD) op = 'h';		sprintf(pt_->buffer() + offset,			"%c "TIME_FORMAT" -s %d -d %d -p %s -k %3s -i %d "			"-N:loc {%.2f %.2f %.2f} -N:en %f ",						op,				// event type			Scheduler::instance().clock(),	// time			src_,				// this node			next_hop,			// next hop			packet_info.name(ch->ptype()),	// packet type			tracename,			// trace level			ch->uid(),			// event id			x, y, z,			// location			energy);				// energy		offset = strlen(pt_->buffer());		if (strcmp (mactype, "Mac/SMAC") == 0) {			format_smac(p, offset);		} else {			format_mac(p, offset);		}		return;	}	// Use new ns trace format to replace the old cmu trace format)	if (newtrace_) {	    	    node_->getLoc(&x, &y, &z);	    // consistence	    if ( op == DROP ) { op = 'd';}	        // basic trace infomation + basic exenstion	    sprintf(pt_->buffer() + offset,		   "%c -t %.9f -Hs %d -Hd %d -Ni %d -Nx %.2f -Ny %.2f -Nz %.2f -Ne %f -Nl %3s -Nw %s ",		    op,                       // event type		    Scheduler::instance().clock(),  // time		    src_,                           // this node                    ch->next_hop_,                  // next hop		    src_,                           // this node		    x,                              // x coordinate		    y,                              // y coordinate		    z,                              // z coordinate		    energy,                         // energy, -1 = not existing		    tracename,                      // trace level                    why);                            // reason	    // mac layer extension	    offset = strlen(pt_->buffer());	    if (strcmp(mactype, "Mac/SMAC") == 0) {		    format_smac(p, offset);	    } else {		    format_mac(p, offset);	    }	    return;	}#ifdef LOG_POSITION        double x = 0.0, y = 0.0, z = 0.0;        node_->getLoc(&x, &y, &z);#endif	sprintf(pt_->buffer() + offset,#ifdef LOG_POSITION		"%c %.9f %d (%6.2f %6.2f) %3s %4s %d %s %d [%x %x %x %x] ",#else		"%c %.9f _%d_ %3s %4s %d %s %d",#endif		op,		Scheduler::instance().clock(),                src_,                           // this node#ifdef LOG_POSITION                x,                y,#endif		tracename,		why,		                ch->uid(),                      // identifier for this event				((ch->ptype() == PT_MAC) ? (		  (mh->dh_fc.fc_subtype == MAC_Subtype_RTS) ? "RTS"  :		  (mh->dh_fc.fc_subtype == MAC_Subtype_CTS) ? "CTS"  :		  (mh->dh_fc.fc_subtype == MAC_Subtype_ACK) ? "ACK"  :		  "UNKN") :		 (ch->ptype() == PT_SMAC) ? (		  (sh->type == RTS_PKT) ? "RTS" :		  (sh->type == CTS_PKT) ? "CTS" :		  (sh->type == ACK_PKT) ? "ACK" :		  (sh->type == SYNC_PKT) ? "SYNC" :		  "UNKN") : 		 packet_info.name(ch->ptype())),		ch->size());		offset = strlen(pt_->buffer());	if (strncmp (mactype, "Mac/SMAC", 8) == 0) {		format_smac(p, offset);	} else {		format_mac(p, offset);        }		offset = strlen(pt_->buffer());	if (thisnode) {		if (thisnode->energy_model()) {			sprintf(pt_->buffer() + offset,				"[energy %f] ",				thisnode->energy_model()->energy());		}        }}voidCMUTrace::format_mac(Packet *p, int offset){	struct hdr_mac802_11 *mh = HDR_MAC802_11(p);		if (pt_->tagged()) {		sprintf(pt_->buffer() + offset,			"-M:dur %x -M:s %x -M:d %x -M:t %x ",			mh->dh_duration,		// MAC: duration						// change wrt Mike's code			//ETHER_ADDR(mh->dh_da),		// MAC: source			//ETHER_ADDR(mh->dh_sa),		// MAC: destination			ETHER_ADDR(mh->dh_ra),          // MAC: source                       ETHER_ADDR(mh->dh_ta),          // MAC: destination			GET_ETHER_TYPE(mh->dh_body));	// MAC: type	} else if (newtrace_) {		sprintf(pt_->buffer() + offset, 			"-Ma %x -Md %x -Ms %x -Mt %x ",			mh->dh_duration,						// change wrt Mike's code			//ETHER_ADDR(mh->dh_da),			//ETHER_ADDR(mh->dh_sa),	   		ETHER_ADDR(mh->dh_ra),	                   ETHER_ADDR(mh->dh_ta),			GET_ETHER_TYPE(mh->dh_body));	} else {		sprintf(pt_->buffer() + offset,			" [%x %x %x %x] ",			//*((u_int16_t*) &mh->dh_fc),			mh->dh_duration,						// change wrt Mike's code			//ETHER_ADDR(mh->dh_da),			//ETHER_ADDR(mh->dh_sa),			ETHER_ADDR(mh->dh_ra),                        ETHER_ADDR(mh->dh_ta),			GET_ETHER_TYPE(mh->dh_body));	}}voidCMUTrace::format_smac(Packet *p, int offset){	struct hdr_smac *sh = HDR_SMAC(p);	sprintf(pt_->buffer() + offset,		" [%.2f %d %d] ",		sh->duration,		sh->dstAddr,		sh->srcAddr);}	voidCMUTrace::format_ip(Packet *p, int offset){        struct hdr_cmn *ch = HDR_CMN(p);	struct hdr_ip *ih = HDR_IP(p);		// hack the IP address to convert pkt format to hostid format	// for now until port ids are removed from IP address. -Padma.	int src = Address::instance().get_nodeaddr(ih->saddr());	int dst = Address::instance().get_nodeaddr(ih->daddr());	if (pt_->tagged()) {		sprintf(pt_->buffer() + offset,			"-IP:s %d -IP:sp %d -IP:d %d -IP:dp %d -p %s -e %d "			"-c %d -i %d -IP:ttl %d ",			src,                           // packet src			ih->sport(),                   // src port			dst,                           // packet dest			ih->dport(),                   // dst port			packet_info.name(ch->ptype()), // packet type			ch->size(),                    // packet size			ih->flowid(),                  // flow id			ch->uid(),                     // unique id			ih->ttl_                       // ttl			);	} else if (newtrace_) {	    sprintf(pt_->buffer() + offset,		    "-Is %d.%d -Id %d.%d -It %s -Il %d -If %d -Ii %d -Iv %d ",		    src,                           // packet src		    ih->sport(),                   // src port		    dst,                           // packet dest		    ih->dport(),                   // dst port		    packet_info.name(ch->ptype()),  // packet type		    ch->size(),                     // packet size		    ih->flowid(),                   // flow id		    ch->uid(),                      // unique id		    ih->ttl_);                      // ttl	} else {	    sprintf(pt_->buffer() + offset, "------- [%d:%d %d:%d %d %d] ",		src, ih->sport(),		dst, ih->dport(),		ih->ttl_, (ch->next_hop_ < 0) ? 0 : ch->next_hop_);	}}voidCMUTrace::format_arp(Packet *p, int offset){	struct hdr_arp *ah = HDR_ARP(p);	if (pt_->tagged()) {	    sprintf(pt_->buffer() + offset,		    "-arp:op %s -arp:ms %d -arp:s %d -arp:md %d -arp:d %d ",		    ah->arp_op == ARPOP_REQUEST ?  "REQUEST" : "REPLY",		    ah->arp_sha,		    ah->arp_spa,		    ah->arp_tha,		    ah->arp_tpa);	} else if (newtrace_) {	    sprintf(pt_->buffer() + offset,		    "-P arp -Po %s -Pms %d -Ps %d -Pmd %d -Pd %d ",		    ah->arp_op == ARPOP_REQUEST ?  "REQUEST" : "REPLY",		    ah->arp_sha,		    ah->arp_spa,		    ah->arp_tha,		    ah->arp_tpa);	} else {

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
91在线观看视频| 夜夜精品视频一区二区| 九色综合国产一区二区三区| 777a∨成人精品桃花网| 日韩成人精品视频| 日韩一级片在线播放| 精东粉嫩av免费一区二区三区| 欧美videos中文字幕| 国产一区二区三区免费播放| 国产精品丝袜久久久久久app| 91丨porny丨户外露出| 亚洲一区二区三区中文字幕| 91精品国产丝袜白色高跟鞋| 久久精工是国产品牌吗| 国产日韩综合av| 在线日韩av片| 紧缚奴在线一区二区三区| 中文字幕中文乱码欧美一区二区| 91小视频免费观看| 人人精品人人爱| 国产精品美女视频| 欧美亚洲日本国产| 黄页视频在线91| 一区二区在线电影| 日韩欧美你懂的| 91视频一区二区三区| 日本欧美在线看| 国产精品入口麻豆九色| 欧美精品久久99| 成人综合在线视频| 日韩中文字幕不卡| 国产精品女上位| 91精品国产综合久久久久久久久久 | 欧美大尺度电影在线| 国产91精品精华液一区二区三区| 午夜亚洲国产au精品一区二区| 久久精品亚洲精品国产欧美| 91高清在线观看| 国产乱码字幕精品高清av| 一区二区成人在线视频| 精品粉嫩aⅴ一区二区三区四区| 色综合色综合色综合色综合色综合| 免费观看日韩av| 亚洲激情图片一区| 国产女主播在线一区二区| 欧美亚洲综合另类| 成人国产在线观看| 加勒比av一区二区| 日本亚洲三级在线| 亚洲成人手机在线| 一区二区三区在线视频观看58| 国产无人区一区二区三区| 欧美精品在线观看一区二区| 91免费版在线| 成人av午夜电影| 国产一区二区三区美女| 六月婷婷色综合| 亚洲成人免费av| 亚洲一卡二卡三卡四卡无卡久久| 国产精品伦理一区二区| 欧美精品一区二区三| 欧美一区二区三区免费| 欧美日韩一区二区三区四区五区| av成人免费在线| 成人黄色大片在线观看| 国产一区二区三区免费看 | 91久久人澡人人添人人爽欧美| 国产美女视频91| 国产一区二区三区久久悠悠色av| 蜜桃免费网站一区二区三区| 日日欢夜夜爽一区| 天天色图综合网| 午夜精品久久久久久久蜜桃app| 一区二区三区精品| 一区二区激情视频| 亚洲最色的网站| 亚洲综合小说图片| 午夜久久久久久| 日韩精品电影一区亚洲| 偷拍亚洲欧洲综合| 日韩电影免费在线观看网站| 日韩成人精品在线观看| 蜜臀av性久久久久蜜臀aⅴ四虎| 日韩福利电影在线| 九九九久久久精品| 国产乱子伦视频一区二区三区| 国产麻豆成人精品| 成人做爰69片免费看网站| 96av麻豆蜜桃一区二区| 91福利在线播放| 91精品国产黑色紧身裤美女| 欧美大片在线观看| 国产精品午夜久久| 一区二区三区欧美久久| 亚洲第一在线综合网站| 日本欧美在线观看| 高清beeg欧美| 91黄视频在线观看| 91精品欧美一区二区三区综合在| 2020国产成人综合网| 国产精品久久久久影院色老大 | 欧美日韩三级视频| 日韩一区二区三区av| 久久你懂得1024| 中文在线一区二区| 亚洲综合视频在线观看| 视频在线在亚洲| 国产一区在线不卡| 色妹子一区二区| 日韩欧美美女一区二区三区| 国产精品美女一区二区| 天天综合色天天综合| 国产麻豆精品在线| 欧美色图片你懂的| 精品国产凹凸成av人导航| 亚洲乱码中文字幕| 麻豆视频一区二区| 91日韩在线专区| 日韩免费观看2025年上映的电影| 国产女人18毛片水真多成人如厕 | 日本韩国一区二区| 欧美videos中文字幕| 一区二区三区在线影院| 精品在线播放免费| 一本久久综合亚洲鲁鲁五月天| 日韩一区二区在线观看视频| 亚洲欧洲性图库| 精品无人区卡一卡二卡三乱码免费卡| 99视频国产精品| 精品999在线播放| 亚洲成人激情社区| www.亚洲人| 国产视频一区二区在线观看| 午夜一区二区三区视频| 99免费精品在线| 久久久不卡网国产精品一区| 日韩电影免费在线看| 欧美在线观看视频一区二区 | 99精品桃花视频在线观看| 日韩久久精品一区| 天天影视色香欲综合网老头| 99久久99久久久精品齐齐| 国产色综合久久| 蜜臀av一区二区| 欧美另类一区二区三区| 亚洲欧美视频一区| a级精品国产片在线观看| 2020日本不卡一区二区视频| 五月激情综合网| 欧美亚洲国产bt| 亚洲欧美韩国综合色| 成人高清视频在线| 久久精品无码一区二区三区| 麻豆精品精品国产自在97香蕉 | 韩国在线一区二区| 欧美一区二区三区啪啪| 天天av天天翘天天综合网色鬼国产| 成人高清av在线| 久久精品亚洲乱码伦伦中文| 国内精品嫩模私拍在线| 欧美精品一区二区三区一线天视频| 丝袜亚洲另类丝袜在线| 欧美丝袜自拍制服另类| 亚洲五月六月丁香激情| 欧美日韩在线播| 亚洲午夜久久久久久久久久久| 欧美影院午夜播放| 亚洲自拍偷拍综合| 欧美日韩一区二区三区高清 | 国产在线一区二区综合免费视频| 91精品国产高清一区二区三区蜜臀| 亚洲mv在线观看| 在线综合视频播放| 九九九久久久精品| 欧美精品一区二区三区蜜臀| 国产精品亚洲一区二区三区在线| 久久精品亚洲麻豆av一区二区| 高清国产一区二区| 亚洲欧美aⅴ...| 欧美色综合网站| 免费精品视频在线| 国产香蕉久久精品综合网| 成人小视频免费观看| 自拍偷拍国产精品| 欧美三级三级三级| 美国十次综合导航| 久久久久久久免费视频了| 成人免费的视频| 亚洲永久免费视频| 欧美一区二区三区四区在线观看| 麻豆精品一区二区三区| 亚洲国产精品v| 欧美伊人久久大香线蕉综合69| 天天色图综合网| 久久久国产精品午夜一区ai换脸| 97久久超碰国产精品| 天天综合网天天综合色| 久久久久久久久免费| 日本韩国精品在线| 紧缚捆绑精品一区二区|