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

📄 nhlist.h

📁 在NS-2环境中实现了移动Ad Hoc的两种广播算法:Flood和Bcast。里面本来有个test目录
💻 H
字号:
/******************************************************************* Copyright (C) 2004 Thomas Kunz, CRC Canada, BCAST for IPv4. DISTRIBUTED WITH NO WARRANTY, EXPRESS OR IMPLIED. See the GNU Library General Public License (file COPYING in the MANET_multicast directory) for conditions of use and redistribution.*********************************************************************/#ifndef __nhlist_h__#define __nhlist_h_#include <config.h>class nh_entry{ 	friend class MAODV;	friend class mt_entry;	friend class nhlist;	friend class ODMRP;public: 	nh_entry();	~nh_entry(){};protected:	nsaddr_t	next_hop;	u_int8_t	enabled_flag;#define NH_DISABLE	0#define NH_ENABLE	1#define NH_DUP		2	u_int8_t	link_direction;#define UPSTREAM	0#define DOWNSTREAM	1	nh_entry	*next_;};class nhlist {public:	nhlist();	~nhlist();	void		add(nh_entry *p);	nh_entry*	top();	nh_entry*	next(nsaddr_t dst);        // Returns next hop from the head of the queue.	nh_entry*	deque(void);        // Returns a next hop for destination "D".	nh_entry*	deque(nsaddr_t dst);		nh_entry*	find(nsaddr_t dst);		//numbers of enabled neighbors		int		size();	int		extrasize();	void		disable();	nh_entry*	findupstream();	nh_entry*	findenabledupstream();	nh_entry*	firsthop();	nh_entry*	hopexcept(nsaddr_t dst);private:	nh_entry*	remove_head();	void		findNextHopWithDst(nsaddr_t dst, nh_entry*& p, nh_entry*& prev);	void		verifyList(void);	nh_entry*	head_;	nh_entry*	tail_;	int		len_;};#endif

⌨️ 快捷键说明

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