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

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

?? mac-tdma.cc

?? 在網絡仿真模擬工具下實現支持時隙的MAC層TDMA協議
?? CC
?? 第 1 頁 / 共 2 頁
字號:
// -*-	Mode:C++; c-basic-offset:8; tab-width:8; indent-tabs-mode:t -*-//// Copyright (c) 1999 by the University of Southern California// All rights reserved.//// Permission to use, copy, modify, and distribute this software and its// documentation in source and binary forms for non-commercial purposes// and without fee is hereby granted, provided that the above copyright// notice appear in all copies and that both the copyright notice and// this permission notice appear in supporting documentation. and that// any documentation, advertising materials, and other materials related// to such distribution and use acknowledge that the software was// developed by the University of Southern California, Information// Sciences Institute.  The name of the University may not be used to// endorse or promote products derived from this software without// specific prior written permission.//// THE UNIVERSITY OF SOUTHERN CALIFORNIA makes no representations about// the suitability of this software for any purpose.  THIS SOFTWARE IS// PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES,// INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.//// Other copyrights might apply to parts of this software and are so// noted when applicable.//// $Header: /nfs/jade/vint/CVSROOT/ns-2/mac/mac-tdma.cc,v 1.12 2004/02/06 16:33:52 xuanc Exp $//// mac-tdma.cc// by Xuan Chen (xuanc@isi.edu), ISI/USC//// Preamble TDMA MAC layer for single hop.// Centralized slot assignment computing.#include "delay.h"#include "connector.h"#include "packet.h"#include "random.h"// #define DEBUG//#include <debug.h>#include "arp.h"#include "ll.h"#include "mac.h"#include "mac-tdma.h"#include "cmu-trace.h"#define SET_RX_STATE(x)			\{					\	rx_state_ = (x);			\}#define SET_TX_STATE(x)				\{						\	tx_state_ = (x);				\}/* Phy specs from 802.11 */static PHY_MIB PMIB = {	DSSS_CWMin, DSSS_CWMax, DSSS_SlotTime, DSSS_CCATime,	DSSS_RxTxTurnaroundTime, DSSS_SIFSTime, DSSS_PreambleLength,	DSSS_PLCPHeaderLength};	/* Timers */void MacTdmaTimer::start(Packet *p, double time){	Scheduler &s = Scheduler::instance();	assert(busy_ == 0);  	busy_ = 1;	paused_ = 0;	stime = s.clock();	rtime = time;	assert(rtime >= 0.0);  	s.schedule(this, p, rtime);}void MacTdmaTimer::stop(Packet *p) {	Scheduler &s = Scheduler::instance();	assert(busy_);  	if(paused_ == 0)		s.cancel((Event *)p);	// Should free the packet p.	Packet::free(p);  	busy_ = 0;	paused_ = 0;	stime = 0.0;	rtime = 0.0;}/* Slot timer for TDMA scheduling. */void SlotTdmaTimer::handle(Event *e){       	busy_ = 0;	paused_ = 0;	stime = 0.0;	rtime = 0.0;  	mac->slotHandler(e);}/* Receive Timer */void RxPktTdmaTimer::handle(Event *e) {       	busy_ = 0;	paused_ = 0;	stime = 0.0;	rtime = 0.0;  	mac->recvHandler(e);}/* Send Timer */void TxPktTdmaTimer::handle(Event *e) {       	busy_ = 0;	paused_ = 0;	stime = 0.0;	rtime = 0.0;  	mac->sendHandler(e);}/* ======================================================================   TCL Hooks for the simulator   ====================================================================== */static class MacTdmaClass : public TclClass {public:	MacTdmaClass() : TclClass("Mac/Tdma") {}	TclObject* create(int, const char*const*) {		return (new MacTdma(&PMIB));	}} class_mac_tdma;// Mac Tdma definitions// Frame format:// Pamble Slot1 Slot2 Slot3...MacTdma::MacTdma(PHY_MIB* p) : 	Mac(), mhSlot_(this), mhTxPkt_(this), mhRxPkt_(this){	/* Global variables setting. */	// Setup the phy specs.	phymib_ = p;		/* Get the parameters of the link (which in bound in mac.cc, 2M by default),	   the packet length within one TDMA slot (1500 byte by default), 	   and the max number of nodes (64) in the simulations.*/	bind("slot_packet_len_", &slot_packet_len_);	bind("max_node_num_", &max_node_num_);		//  slot_packet_len_ = 1500;	//  max_node_num_ = 64;	// Calculate the slot time based on the MAX allowed data length.	slot_time_ = DATA_Time(slot_packet_len_);		/* Calsulate the max slot num within on frame from max node num.	   In the simple case now, they are just equal. 	*/	max_slot_num_ = max_node_num_;		/* Much simplified centralized scheduling algorithm for single hop	   topology, like WLAN etc. 	*/	// Initualize the tdma schedule and preamble data structure.	tdma_schedule_ = new int[max_slot_num_];	tdma_preamble_ = new int[max_slot_num_];	/* Do each node's initialization. */	// Record the initial active node number.	active_node_++;	if (active_node_ > max_node_num_) {		printf("Too many nodes taking part in the simulations, aborting...\n");		exit(-1);	}    	// Initial channel / transceiver states. 	tx_state_ = rx_state_ = MAC_IDLE;	tx_active_ = 0;	// Initialy, the radio is off. NOTE: can't use radioSwitch(OFF) here.	radio_active_ = 0;	// Do slot scheduling.	re_schedule();	/* Deal with preamble. */	// Can't send anything in the first frame.	slot_count_ = FIRST_ROUND;	tdma_preamble_[slot_num_] = NOTHING_TO_SEND;	//Start the Slot timer..	mhSlot_.start((Packet *) (& intr_), 0);  }/* similar to 802.11, no cached node lookup. */int MacTdma::command(int argc, const char*const* argv){	if (argc == 3) {		if (strcmp(argv[1], "log-target") == 0) {			logtarget_ = (NsObject*) TclObject::lookup(argv[2]);			if(logtarget_ == 0)				return TCL_ERROR;			return TCL_OK;		}	}	return Mac::command(argc, argv);}/* ======================================================================   Debugging Routines   ====================================================================== */void MacTdma::trace_pkt(Packet *p) {	struct hdr_cmn *ch = HDR_CMN(p);	struct hdr_mac_tdma* dh = HDR_MAC_TDMA(p);	u_int16_t *t = (u_int16_t*) &dh->dh_fc;	fprintf(stderr, "\t[ %2x %2x %2x %2x ] %x %s %d\n",		*t, dh->dh_duration,		ETHER_ADDR(dh->dh_da), ETHER_ADDR(dh->dh_sa),		index_, packet_info.name(ch->ptype()), ch->size());}void MacTdma::dump(char *fname){	fprintf(stderr, "\n%s --- (INDEX: %d, time: %2.9f)\n", fname, 		index_, Scheduler::instance().clock());		fprintf(stderr, "\ttx_state_: %x, rx_state_: %x, idle: %d\n", 		tx_state_, rx_state_, is_idle());	fprintf(stderr, "\tpktTx_: %x, pktRx_: %x, callback: %x\n", 		(int) pktTx_, (int) pktRx_, (int) callback_);}/* ======================================================================   Packet Headers Routines   ====================================================================== */int MacTdma::hdr_dst(char* hdr, int dst ){	struct hdr_mac_tdma *dh = (struct hdr_mac_tdma*) hdr;	if(dst > -2)		STORE4BYTE(&dst, (dh->dh_da));	return ETHER_ADDR(dh->dh_da);}int MacTdma::hdr_src(char* hdr, int src ){	struct hdr_mac_tdma *dh = (struct hdr_mac_tdma*) hdr;	if(src > -2)		STORE4BYTE(&src, (dh->dh_sa));  	return ETHER_ADDR(dh->dh_sa);}int MacTdma::hdr_type(char* hdr, u_int16_t type) {	struct hdr_mac_tdma *dh = (struct hdr_mac_tdma*) hdr;	if(type)		STORE2BYTE(&type,(dh->dh_body));	return GET2BYTE(dh->dh_body);}/* Test if the channel is idle. */int MacTdma::is_idle() {	if(rx_state_ != MAC_IDLE)		return 0;	if(tx_state_ != MAC_IDLE)		return 0;	return 1;}/* Do the slot re-scheduling:   The idea of postphone the slot scheduling for one slot time may be useful.*/void MacTdma::re_schedule() {	static int slot_pointer = 0;	// Record the start time of the new schedule.	start_time_ = NOW;	/* Seperate slot_num_ and the node id: 	   we may have flexibility as node number changes.	*/	slot_num_ = slot_pointer++;	tdma_schedule_[slot_num_] = (char) index_;}/* To handle incoming packet. */

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
色先锋aa成人| 精品久久久久av影院| 日韩三级高清在线| 国产精品网站在线播放| 亚洲高清视频在线| 国产高清成人在线| 51久久夜色精品国产麻豆| 中文字幕av一区二区三区免费看| 亚洲国产精品麻豆| 成人理论电影网| 精品国一区二区三区| 午夜精品aaa| 色老汉一区二区三区| 久久精品欧美日韩| 美女久久久精品| 精品视频在线免费| 伊人一区二区三区| 91最新地址在线播放| 中文字幕二三区不卡| 国产一区二区不卡| 欧美大黄免费观看| 老司机精品视频线观看86| 欧美日韩精品电影| 亚洲国产欧美在线| 欧美午夜精品免费| 一区二区三区在线播放| 91视频.com| 自拍视频在线观看一区二区| 成人黄色a**站在线观看| 中文在线免费一区三区高中清不卡| 六月婷婷色综合| 欧美一区二区三区婷婷月色| 日韩精品视频网| 欧美电视剧在线看免费| 裸体健美xxxx欧美裸体表演| 日韩欧美久久久| 国产精选一区二区三区| 欧美激情一区二区三区蜜桃视频| 国产成人在线观看免费网站| 国产精品三级视频| 91网站最新地址| 亚洲综合免费观看高清完整版 | 日韩欧美一级片| 秋霞午夜av一区二区三区| 91精品国产色综合久久ai换脸| 男人的天堂久久精品| 精品国产伦一区二区三区观看体验 | 男女性色大片免费观看一区二区| 91精品国产91久久综合桃花| 美女看a上一区| 中文字幕不卡一区| 在线观看视频91| 日本午夜一区二区| 国产三级一区二区三区| 色综合久久综合中文综合网| 亚洲国产精品久久久久婷婷884 | 日韩一区二区三区电影| 国产一区视频导航| 亚洲欧洲无码一区二区三区| 日本韩国精品在线| 老司机免费视频一区二区| 久久精品水蜜桃av综合天堂| 91麻豆国产精品久久| 免费在线看一区| 欧美激情一区在线| 在线电影院国产精品| 国产河南妇女毛片精品久久久 | 欧美视频一区二区| 精品一区二区在线免费观看| 国产精品久久久久毛片软件| 欧美丝袜自拍制服另类| 国产一区二区三区免费观看| 亚洲国产日韩a在线播放性色| 337p日本欧洲亚洲大胆色噜噜| 91蝌蚪porny| 久久国产精品区| 亚洲精选一二三| 精品美女在线观看| 欧美综合视频在线观看| 国产成人一区二区精品非洲| 亚洲午夜久久久久久久久久久| 久久久亚洲午夜电影| 欧美日本高清视频在线观看| 成人听书哪个软件好| 日韩成人精品视频| 亚洲综合成人在线视频| 欧美韩国日本综合| 91精品国产91综合久久蜜臀| 在线中文字幕一区二区| 成人app在线观看| 国产一区二区不卡| 免费不卡在线视频| 亚洲成av人片| 亚洲激情在线激情| 欧美国产精品劲爆| 久久蜜臀中文字幕| 日韩精品一区二区三区在线观看 | 91视视频在线直接观看在线看网页在线看| 全国精品久久少妇| 视频在线观看一区二区三区| 亚洲久本草在线中文字幕| 国产日韩精品一区二区浪潮av| 3d动漫精品啪啪一区二区竹菊| 91女人视频在线观看| 成人国产精品免费观看视频| 国产中文字幕一区| 久久成人精品无人区| 免费在线观看一区二区三区| 亚洲 欧美综合在线网络| 亚洲欧美国产77777| 亚洲视频综合在线| 成人免费一区二区三区在线观看| 中文字幕乱码久久午夜不卡 | 五月激情综合网| 亚洲国产美国国产综合一区二区| 亚洲免费观看在线视频| 亚洲精品视频在线观看免费| 亚洲欧美韩国综合色| 亚洲一区二区视频| 一区二区理论电影在线观看| 亚洲线精品一区二区三区八戒| 亚洲高清免费观看| 日本美女一区二区三区视频| 蜜臀av性久久久久蜜臀aⅴ| 老司机精品视频线观看86| 国产伦精品一区二区三区免费迷| 国产在线观看免费一区| 成人性生交大合| 99久久婷婷国产精品综合| 欧美亚洲综合一区| 欧美一区二区三区白人| 久久久久久亚洲综合| 亚洲欧美在线高清| 亚洲一区二区三区美女| 日本欧美肥老太交大片| 国产一区二区成人久久免费影院| www.日本不卡| 欧美亚洲自拍偷拍| 欧美成人女星排行榜| 久久精品一区二区三区四区| 日韩理论在线观看| 日本亚洲视频在线| 成人福利视频网站| 欧美日韩午夜影院| 久久中文娱乐网| 亚洲美女屁股眼交3| 日本亚洲欧美天堂免费| caoporm超碰国产精品| 欧美片网站yy| 久久久久久久国产精品影院| 亚洲精品日韩专区silk| 蜜臀av亚洲一区中文字幕| 成人白浆超碰人人人人| 7777女厕盗摄久久久| 国产精品精品国产色婷婷| 亚洲sss视频在线视频| 国产综合一区二区| 欧美性三三影院| 国产亚洲精品aa| 天天av天天翘天天综合网色鬼国产 | 国产日产欧美一区| 亚洲国产aⅴ天堂久久| 国产不卡视频一区二区三区| 欧美日韩国产一区| 欧美国产乱子伦| 琪琪一区二区三区| 在线视频欧美区| 国产欧美在线观看一区| 日韩精品电影在线观看| 91亚洲精华国产精华精华液| 精品国产伦一区二区三区观看方式| 一区二区三区在线免费播放| 国产成人av网站| 91精品福利在线一区二区三区| 亚洲日本电影在线| 国产成人一区在线| 2021久久国产精品不只是精品| 亚洲福利一区二区| 91麻豆精品一区二区三区| 中文子幕无线码一区tr| 久久成人羞羞网站| 欧美一区二区三级| 亚洲国产综合视频在线观看| 99久久夜色精品国产网站| 久久精品视频一区二区| 久久精品国产99久久6| 欧美伦理影视网| 亚洲自拍欧美精品| 色婷婷亚洲精品| 亚洲欧美另类综合偷拍| 成人教育av在线| 国产三级精品视频| 国产精品456露脸| 欧美国产欧美综合| 99久久精品国产导航| 中文字幕二三区不卡| av电影天堂一区二区在线观看| 欧美国产精品v| 成人aa视频在线观看| 亚洲欧洲av色图|