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

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

?? mac-tdma.h

?? 在網絡仿真模擬工具下實現(xiàn)支持時隙的MAC層TDMA協(xié)議
?? H
字號:
// 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.//// 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一区二区三区免费野_久草精品视频
国产乱人伦精品一区二区在线观看 | 精品一区二区综合| 蜜桃视频在线观看一区二区| 免费欧美高清视频| 成人美女在线视频| 欧美中文字幕亚洲一区二区va在线| 欧美色爱综合网| 国产午夜精品在线观看| 亚洲欧美日韩小说| 玖玖九九国产精品| 欧美三级中文字| 午夜精品免费在线| 高清成人在线观看| 日韩欧美视频一区| 国产精品成人一区二区艾草| 天天操天天干天天综合网| 欧美日韩成人一区| 一区二区三区日韩欧美精品| 久草在线在线精品观看| 久久九九久久九九| 99久久亚洲一区二区三区青草| 日韩欧美在线影院| 午夜av电影一区| 日韩欧美久久久| 99麻豆久久久国产精品免费| 国产视频不卡一区| 日本精品视频一区二区| **欧美大码日韩| 成人性视频免费网站| 亚洲国产日韩精品| 在线观看免费一区| 国产在线视频一区二区三区| 日韩一区国产二区欧美三区| 国产不卡视频一区| 日本中文字幕一区二区有限公司| 日本精品视频一区二区| 青椒成人免费视频| 国产精品毛片大码女人| 国产mv日韩mv欧美| 亚洲成a人片在线不卡一二三区| 色婷婷av一区| 亚洲精品国产精品乱码不99| 色综合久久精品| 久久av老司机精品网站导航| 亚洲欧美另类图片小说| 日韩欧美中文一区二区| 色婷婷综合久久久中文一区二区| 六月丁香婷婷久久| 一区二区三区高清| 欧美激情中文字幕一区二区| 国产在线视频不卡二| 亚洲午夜激情av| 国产精品久久久久影院| 欧美一级专区免费大片| 黄色精品一二区| 亚洲福中文字幕伊人影院| 国产欧美久久久精品影院| 午夜精品久久久久久久久久久 | 欧美午夜不卡在线观看免费| 精品国产亚洲在线| 蜜桃久久久久久| 国产精品久久久久一区| 日韩亚洲欧美高清| 91亚洲大成网污www| 久久久久久久久久看片| 国产精品99久久久久久久女警| 亚洲美女一区二区三区| 欧美不卡一二三| 肉肉av福利一精品导航| 国产99一区视频免费| 日韩在线一二三区| 亚洲视频在线一区二区| 色婷婷久久久综合中文字幕| 久久精品免费看| 亚洲一区二区av电影| 国产欧美综合在线观看第十页 | 色综合欧美在线| 久久黄色级2电影| 夜夜嗨av一区二区三区四季av| 久久―日本道色综合久久| 3atv一区二区三区| 久久精品国产一区二区| 夜夜操天天操亚洲| 久久综合国产精品| 99久久综合99久久综合网站| 激情文学综合网| 日韩极品在线观看| 国产精品久久久久久久久久久免费看 | 麻豆91精品91久久久的内涵| 国产欧美一区二区精品性色| 日韩欧美一区二区久久婷婷| 91麻豆精品国产91| 欧美三日本三级三级在线播放| 色噜噜狠狠色综合欧洲selulu| 97久久超碰精品国产| 不卡av免费在线观看| 五月天国产精品| 亚洲一区二区三区国产| 国产精品日日摸夜夜摸av| 国产性色一区二区| 精品久久99ma| 国产欧美一区二区精品仙草咪| 久久综合给合久久狠狠狠97色69| 精品国产一区二区国模嫣然| 精品少妇一区二区三区免费观看| 日韩一区二区三区免费看 | 欧美成人a在线| 91精品国产综合久久福利| 欧美一区中文字幕| 欧美哺乳videos| 337p粉嫩大胆噜噜噜噜噜91av| 欧美tickling挠脚心丨vk| 欧美第一区第二区| 久久你懂得1024| 久久婷婷色综合| 亚洲欧美日韩在线播放| 亚洲妇熟xx妇色黄| 日韩av午夜在线观看| 激情文学综合网| 99久久er热在这里只有精品66| 91香蕉视频污| 欧美日本韩国一区| 欧美日韩国产大片| 欧美电影免费观看高清完整版| 欧美国产禁国产网站cc| 亚洲美腿欧美偷拍| 美女性感视频久久| 成年人午夜久久久| 欧美日韩三级一区| 欧美一区二区精美| 国产精品国产三级国产三级人妇| 亚洲免费高清视频在线| 午夜av一区二区| 国产91精品一区二区麻豆网站| 91精彩视频在线观看| 91精品国产综合久久久久久久| 欧美美女视频在线观看| 国产欧美日韩亚州综合| 亚洲综合在线视频| 激情综合五月婷婷| 国产高清一区日本| 色一区在线观看| 欧美亚洲高清一区| 国产日产亚洲精品系列| 中文久久乱码一区二区| 夜夜嗨av一区二区三区中文字幕 | 免费亚洲电影在线| 91在线免费看| 欧美精品一区二区三| 亚洲裸体在线观看| 国精品**一区二区三区在线蜜桃| 99re成人精品视频| 精品国产精品一区二区夜夜嗨 | 欧美亚洲国产一区二区三区va| 欧美成人aa大片| 亚洲丰满少妇videoshd| 成人一级视频在线观看| 日韩一二三区视频| 亚洲欧美国产毛片在线| 国产精品资源在线观看| 欧美撒尿777hd撒尿| 国产精品二三区| 日韩电影在线一区二区| 欧美另类videos死尸| 国产精品国产三级国产普通话99 | 欧美电影免费观看高清完整版| 亚洲va欧美va天堂v国产综合| 成人动漫一区二区| 精品国产青草久久久久福利| 亚洲综合av网| 成人免费三级在线| 精品国产自在久精品国产| 午夜视黄欧洲亚洲| 色综合久久88色综合天天6| 国产人伦精品一区二区| 精品一区二区三区av| 91精品国产一区二区| 亚洲va天堂va国产va久| 欧美亚洲一区二区在线| 一区二区三区欧美| 99久久99久久精品国产片果冻 | 欧美亚洲一区三区| 精品对白一区国产伦| 亚洲卡通动漫在线| 在线一区二区视频| 韩国女主播一区二区三区| 一本到不卡免费一区二区| 亚洲狼人国产精品| 色诱亚洲精品久久久久久| 一区二区三区中文字幕| 97精品久久久久中文字幕| 一区二区三区在线观看欧美| 91免费版在线| 中文字幕不卡三区| 99久久精品免费精品国产| 日本一区二区高清| 99这里只有精品| 亚洲图片激情小说| 91久久国产最好的精华液| 三级久久三级久久|