⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 wimedia_pnc.h

📁 ns2.31下的UWB(Ultra WideBand)实现
💻 H
字号:
#ifndef WiMedia_PNC_H#define WiMedia_PNC_H#include <mac.h>#include "WiMedia.h"#include "WiMedia_defs.h"#include "mac-timers2.h"struct PNCFlowInfo {	// Main 3 parameters. ust be set by the scheduler...	int flow_id_;	int dev_id_;	int alloc_;	// Used to generate idle time distribution statistics	int idle_time_used_;		// Optional parameters to support different scheduling algorithms	int bw_;	// bandwidth	int util_;	// minimum utilization guaranteed	int budget_;	int budget_used_;		int qs_;	// only thsi is in terms of pkt size	int overload_;	bool budget_exhausted;	bool IAmStatisfied;		TrafficType traffic_type_;	MacACKType ack_type_;	int max_ack_;		// CBS Specific	double q_deadline_;	double period_;};enum PNCType {	PNC_None, PNC_802_15_3, PNC_802_11};class IPNCScheduler {public:	virtual void StartBeaconing(BeaconTimer2 *beaconTimer) = 0;	virtual void OnBeaconTimer(BeaconTimer2 *beaconTimer) = 0;	virtual int ExecuteCommand(int argc, const char* const* argv) = 0;	virtual void ProcessPacket(Packet *p) = 0;		virtual void PrintTitle() = 0;};class PNC {public:	PNC(Mac_WiMedia *mac, MacMib *macmib);	~PNC();		void SetPNCType(PNCType type);		void SetScheduler(const char* name);	void AddNode(int dev_id);	void StartBeaconing(BeaconTimer2 * beaconTimer);	void OnBeaconTimer(BeaconTimer2 *beaconTimer);	void StartPolling(int sf_size, BeaconTimer2 *beaconTimer);	void ProcessPacket(Packet *p);		int ExecuteCommand(int argc, const char*const* argv);		void UpdateGroupPollingBeacon(int aFirstGTSGap);	void SetPNCSchedule();	void PrintTitle();public:	Mac_WiMedia *mac_;	MacMib	*macmib_;	Packet *pktBeacon_;	// set to false by PNC if standard 802.15.3 mode is selected	bool	enhanced_mode_;	// total number of flows scheduled in the current superframe	int flow_count_;	PNCFlowInfo flow_info_[MAX_FLOWS];protected:	IPNCScheduler *scheduler_;	PNCType type_;};#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -