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

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

?? mac-tdma.h

?? 適合研究ns2
?? H
字號:
/* * mac-tdma.h * Copyright (C) 1999 by the University of Southern California * $Id: mac-tdma.h,v 1.5 2005/08/25 18:58:07 johnh Exp $ * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License, * version 2, as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. * * * The copyright of this module includes the following * linking-with-specific-other-licenses addition: * * In addition, as a special exception, the copyright holders of * this module give you permission to combine (via static or * dynamic linking) this module with free software programs or * libraries that are released under the GNU LGPL and with code * included in the standard release of ns-2 under the Apache 2.0 * license or under otherwise-compatible licenses with advertising * requirements (or modified versions of such code, with unchanged * license).  You may copy and distribute such a system following the * terms of the GNU GPL for this module and the licenses of the * other code concerned, provided that you include the source code of * that other code when and as the GNU GPL requires distribution of * source code. * * Note that people who make modified versions of this module * are not obligated to grant this special exception for their * modified versions; it is their choice whether to do so.  The GNU * General Public License gives permission to release a modified * version without this exception; this exception also makes it * possible to release a modified version which carries forward this * exception. * *///// mac-tdma.h// by Xuan Chen (xuanc@isi.edu), ISI/USC.// // Preamble TDMA MAC layer for single hop.// Centralized slot assignment computing.#ifndef ns_mac_tdma_h#define ns_mac_tdma_h// #define DEBUG//#include <debug.h>#include "marshall.h"#include <delay.h>#include <connector.h>#include <packet.h>#include <random.h>#include <arp.h>#include <ll.h>#include <mac.h>#define GET_ETHER_TYPE(x)		GET2BYTE((x))#define SET_ETHER_TYPE(x,y)            {u_int16_t t = (y); STORE2BYTE(x,&t);}/* We are still using these specs for phy layer---same as 802.11. *//* * IEEE 802.11 Spec, section 15.3.2 *	- default values for the DSSS PHY MIB */#define DSSS_CWMin			31#define DSSS_CWMax			1023#define DSSS_SlotTime			0.000020	// 20us#define	DSSS_CCATime			0.000015	// 15us#define DSSS_RxTxTurnaroundTime		0.000005	// 5us#define DSSS_SIFSTime			0.000010	// 10us#define DSSS_PreambleLength		144		// 144 bits#define DSSS_PLCPHeaderLength		48		// 48 bitsclass PHY_MIB {public:	u_int32_t	CWMin;	u_int32_t	CWMax;	double		SlotTime;	double		CCATime;	double		RxTxTurnaroundTime;	double		SIFSTime;	u_int32_t	PreambleLength;	u_int32_t	PLCPHeaderLength;};/* ======================================================================   Frame Formats   ====================================================================== */#define	MAC_ProtocolVersion	0x00#define MAC_Type_Data		0x02#define MAC_Subtype_Data	0x00// Max data length allowed in one slot (byte)#define MAC_TDMA_MAX_DATA_LEN 1500        // How many time slots in one frame.#define MAC_TDMA_SLOT_NUM       32           // The mode for MacTdma layer's defer timers. */#define SLOT_SCHE               0#define SLOT_SEND               1#define SLOT_RECV               2#define SLOT_BCAST              3// Indicate if there is a packet needed to be sent out.#define NOTHING_TO_SEND         -2// Indicate if this is the very first time the simulation runs.#define FIRST_ROUND             -1// Turn radio on /off#define ON                       1#define OFF                      0/* Quoted from MAC-802.11. */#define DATA_DURATION           5/* We are using same header structure as 802.11 currently */struct frame_control {	u_char		fc_subtype		: 4;	u_char		fc_type			: 2;	u_char		fc_protocol_version	: 2;	u_char		fc_order		: 1;	u_char		fc_wep			: 1;	u_char		fc_more_data		: 1;	u_char		fc_pwr_mgt		: 1;	u_char		fc_retry		: 1;	u_char		fc_more_frag		: 1;	u_char		fc_from_ds		: 1;	u_char		fc_to_ds		: 1;};struct hdr_mac_tdma {	struct frame_control	dh_fc;	u_int16_t		dh_duration;	u_char			dh_da[ETHER_ADDR_LEN];	u_char			dh_sa[ETHER_ADDR_LEN];	u_char			dh_bssid[ETHER_ADDR_LEN];	u_int16_t		dh_scontrol;	u_char			dh_body[0]; // XXX Non-ANSI};#define ETHER_HDR_LEN				\	((phymib_->PreambleLength >> 3) +	\	 (phymib_->PLCPHeaderLength >> 3) +	\	 sizeof(struct hdr_mac_tdma) +		\	 ETHER_FCS_LEN)#define DATA_Time(len)	(8 * (len) / bandwidth_)/* ======================================================================   The following destination class is used for duplicate detection.   ====================================================================== */// We may need it later for caching...class Host {public:	LIST_ENTRY(Host) link;	u_int32_t	index;	u_int32_t	seqno;};/* Timers */class MacTdma;class MacTdmaTimer : public Handler {public:	MacTdmaTimer(MacTdma* m, double s = 0) : mac(m) {		busy_ = paused_ = 0; stime = rtime = 0.0; slottime_ = s;	}	virtual void handle(Event *e) = 0;	virtual void start(Packet *p, double time);	virtual void stop(Packet *p);	virtual void pause(void) { assert(0); }	virtual void resume(void) { assert(0); }	inline int busy(void) { return busy_; }	inline int paused(void) { return paused_; }	inline double slottime(void) { return slottime_; }	inline double expire(void) {		return ((stime + rtime) - Scheduler::instance().clock());	}protected:	MacTdma 	*mac;	int		busy_;	int		paused_;	Event		intr;	double		stime;	// start time	double		rtime;	// remaining time	double		slottime_;};/* Timers to schedule transmitting and receiving. */class SlotTdmaTimer : public MacTdmaTimer {public:	SlotTdmaTimer(MacTdma *m) : MacTdmaTimer(m) {}	void	handle(Event *e);};/* Timers to control packet sending and receiving time. */class RxPktTdmaTimer : public MacTdmaTimer {public:	RxPktTdmaTimer(MacTdma *m) : MacTdmaTimer(m) {}	void	handle(Event *e);};class TxPktTdmaTimer : public MacTdmaTimer {public:	TxPktTdmaTimer(MacTdma *m) : MacTdmaTimer(m) {}	void	handle(Event *e);};/* TDMA Mac layer. */class MacTdma : public Mac {  friend class SlotTdmaTimer;  friend class TxPktTdmaTimer;  friend class RxPktTdmaTimer; public:  MacTdma(PHY_MIB* p);  void		recv(Packet *p, Handler *h);  inline int	hdr_dst(char* hdr, int dst = -2);  inline int	hdr_src(char* hdr, int src = -2);  inline int	hdr_type(char* hdr, u_int16_t type = 0);    /* Timer handler */  void slotHandler(Event *e);  void recvHandler(Event *e);  void sendHandler(Event *e);   protected:  PHY_MIB		*phymib_;    // Both the slot length and max slot num (max node num) can be configged.  int			slot_packet_len_;  int                   max_node_num_;   private:  int command(int argc, const char*const* argv);  // Do slot scheduling for the active nodes within one cluster.  void re_schedule();  void makePreamble();  void radioSwitch(int i);  /* Packet Transmission Functions.*/  void    sendUp(Packet* p);  void    sendDown(Packet* p);    /* Actually receive data packet when rxTimer times out. */  void recvDATA(Packet *p);  /* Actually send the packet buffered. */  void send();  inline int	is_idle(void);    /* Debugging Functions.*/  void		trace_pkt(Packet *p);  void		dump(char* fname);    void mac_log(Packet *p) {    logtarget_->recv(p, (Handler*) 0);  }    inline double TX_Time(Packet *p) {    double t = DATA_Time((HDR_CMN(p))->size());    //    printf("<%d>, packet size: %d, tx-time: %f\n", index_, (HDR_CMN(p))->size(), t);    if(t < 0.0) {      drop(p, "XXX");      exit(1);    }    return t;  }    inline u_int16_t usec(double t) {    u_int16_t us = (u_int16_t)ceil(t *= 1e6);    return us;  };  /* Timers */  SlotTdmaTimer mhSlot_;  TxPktTdmaTimer mhTxPkt_;  RxPktTdmaTimer mhRxPkt_;  /* Internal MAC state */  MacState	rx_state_;	// incoming state (MAC_RECV or MAC_IDLE)  MacState	tx_state_;	// outgoing state    /* The indicator of the radio. */  int radio_active_;  int		tx_active_;	// transmitter is ACTIVE    NsObject*	logtarget_;    /* TDMA scheduling state.      Currently, we only use a centralized simplified way to do      scheduling. Will work on the algorithm later.*/  // The max num of slot within one frame.  static int max_slot_num_;  // The time duration for each slot.  static double slot_time_;  /* The start time for whole TDMA scheduling. */  static double start_time_;    /* Data structure for tdma scheduling. */  static int active_node_;            // How many nodes needs to be scheduled  static int *tdma_schedule_;  int slot_num_;                      // The slot number it's allocated.  static int *tdma_preamble_;        // The preamble data structure.  // When slot_count_ = active_nodes_, a new preamble is needed.  int slot_count_;    // How many packets has been sent out?  static int tdma_ps_;  static int tdma_pr_;};double MacTdma::slot_time_ = 0;double MacTdma::start_time_ = 0;int MacTdma::active_node_ = 0;int MacTdma::max_slot_num_ = 0;int *MacTdma::tdma_schedule_ = NULL;int *MacTdma::tdma_preamble_ = NULL;int MacTdma::tdma_ps_ = 0;int MacTdma::tdma_pr_ = 0;#endif /* __mac_tdma_h__ */

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
精品一区免费av| 2欧美一区二区三区在线观看视频| 成熟亚洲日本毛茸茸凸凹| 国产成人三级在线观看| 成人精品视频一区二区三区尤物| 国产精品88888| 欧美性xxxxxx少妇| 久久综合给合久久狠狠狠97色69| 久久夜色精品一区| 亚洲一区国产视频| 岛国一区二区三区| 精品久久人人做人人爱| 亚洲综合久久久| 91亚洲男人天堂| 久久精品无码一区二区三区| 亚洲曰韩产成在线| 国产毛片精品一区| 欧美日韩国产免费一区二区| 国产精品国产三级国产普通话蜜臀| 日本不卡视频一二三区| 91黄色免费版| 亚洲欧洲综合另类| 99国内精品久久| 国产午夜亚洲精品理论片色戒| 青青草成人在线观看| 在线亚洲+欧美+日本专区| 国产精品国产自产拍高清av | 美女视频一区在线观看| 欧美日韩和欧美的一区二区| 亚洲最快最全在线视频| 色诱亚洲精品久久久久久| 综合电影一区二区三区| 成人午夜激情视频| 亚洲精品日韩专区silk| 91免费在线播放| 午夜精品影院在线观看| 欧美一级二级在线观看| 国产一区三区三区| 中文字幕精品—区二区四季| 成人涩涩免费视频| 亚洲一区二区三区四区在线免费观看 | 色婷婷综合久色| 亚洲国产wwwccc36天堂| 欧美日韩精品高清| 国产传媒一区在线| 图片区日韩欧美亚洲| 亚洲欧美日韩中文播放| 欧美一区二区三区在线看| 国产一区二区精品久久99| 亚洲一级在线观看| 国产精品女上位| 日韩欧美国产一区在线观看| 9色porny自拍视频一区二区| 日本在线观看不卡视频| 一区二区视频在线| 国产精品久久久久婷婷二区次| 欧美岛国在线观看| 欧美肥妇毛茸茸| 欧美在线观看一二区| 成人av网址在线| 国产精品一区不卡| 粉嫩一区二区三区性色av| 国产在线一区二区综合免费视频| 国产精品第一页第二页第三页| 久久伊人蜜桃av一区二区| 日韩一区二区在线观看| 欧美日韩三级一区| 日韩一级成人av| 精品美女一区二区| 国产亚洲一本大道中文在线| 久久久久久9999| 国产精品久久一级| 亚洲一二三区不卡| 日本视频一区二区| 国产传媒欧美日韩成人| 国产一区视频导航| 99视频精品在线| 日本精品视频一区二区| 欧美丰满美乳xxx高潮www| 精品久久国产老人久久综合| 日韩一区日韩二区| 午夜私人影院久久久久| 麻豆精品久久久| 91免费小视频| 国产午夜一区二区三区| 亚洲精品你懂的| 麻豆成人久久精品二区三区红| 懂色av一区二区三区免费看| 91久久精品一区二区| 久久一夜天堂av一区二区三区| 亚洲欧美自拍偷拍色图| 国产一区二区三区| 欧美一区二区三区四区久久| 欧美国产丝袜视频| 另类小说图片综合网| 91啪亚洲精品| 亚洲九九爱视频| 97se狠狠狠综合亚洲狠狠| 久久久久久久综合狠狠综合| 亚洲影院久久精品| 91一区一区三区| 久久久久久久av麻豆果冻| 一区二区三区成人| 欧美羞羞免费网站| 久久久久综合网| 国产麻豆成人精品| 久久久精品免费网站| 青娱乐精品视频| 欧美变态口味重另类| 精品一区二区日韩| 国产精品久久三| 国产美女一区二区| 国产欧美日韩麻豆91| 福利电影一区二区三区| 国产精品乱码人人做人人爱 | 国产精品久久久久久久午夜片| 亚洲成人动漫在线观看| 欧美性色欧美a在线播放| 国产精品乱人伦一区二区| 91小视频免费观看| 五月天网站亚洲| 国产精品私人影院| 欧美卡1卡2卡| 国产成a人亚洲精品| 亚洲综合偷拍欧美一区色| 欧美另类videos死尸| 国产精品系列在线观看| 亚洲综合免费观看高清完整版| 久久美女艺术照精彩视频福利播放| 91小视频在线| 大陆成人av片| 国产成人精品一区二区三区网站观看| 午夜一区二区三区视频| 欧美激情一区二区三区蜜桃视频 | 欧美一区二区三区视频在线| 99精品视频在线免费观看| 日本成人在线看| 综合欧美一区二区三区| 亚洲黄色小视频| 亚洲影视在线观看| 中文字幕在线不卡| 国产午夜精品一区二区| 精品欧美久久久| 日韩一区二区在线播放| 日韩美女一区二区三区| 日韩欧美国产一区二区在线播放| 欧美性感一类影片在线播放| bt欧美亚洲午夜电影天堂| 一本一道久久a久久精品 | 美女视频黄 久久| 久久国产福利国产秒拍| 日韩不卡在线观看日韩不卡视频| 日韩精品国产欧美| 婷婷激情综合网| 美美哒免费高清在线观看视频一区二区| 香蕉av福利精品导航| 亚洲国产aⅴ成人精品无吗| 日本少妇一区二区| 国产麻豆精品95视频| 高清不卡一二三区| 99久久精品久久久久久清纯| 92国产精品观看| 9191成人精品久久| 中文字幕精品一区二区精品绿巨人 | 亚洲色欲色欲www在线观看| 1区2区3区精品视频| 日韩福利电影在线| 免费日本视频一区| jlzzjlzz欧美大全| 国产老妇另类xxxxx| 日韩在线卡一卡二| 午夜影院在线观看欧美| 一区二区三区高清| 亚洲三级在线免费观看| 亚洲精品少妇30p| 亚洲手机成人高清视频| 国产精品麻豆99久久久久久| 欧美成va人片在线观看| 欧美tickling挠脚心丨vk| 久久精品男人天堂av| 欧美高清精品3d| 自拍偷自拍亚洲精品播放| 亚洲国产日韩精品| 欧美无人高清视频在线观看| 国产欧美日韩精品在线| 91久久精品一区二区三| 欧美日韩一级大片网址| 国产精品1区2区3区| 麻豆精品一区二区综合av| 福利一区福利二区| 在线观看一区不卡| 欧美一区二视频| 国产欧美日韩在线| 亚洲欧美一区二区三区国产精品| 亚洲一区二区三区在线播放| 99国产一区二区三精品乱码| 国产原创一区二区| 色婷婷国产精品| 中文字幕亚洲区| 欧美aⅴ一区二区三区视频|