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

📄 mflood.h

📁 ns-2中洪泛源程序
💻 H
字号:

#ifndef __mflood_h__
#define __mflood_h__

#include <sys/types.h>
#include <cmu-trace.h>
#include <priqueue.h>
#include "mflood-seqtable.h"
#include <list>



#define NOW_ (Scheduler::instance().clock())

// Should be set by the user using best guess (conservative)
#define NETWORK_DIAMETER 30	// 30 hops
 
// The followings are used for the forward() function. Controls pacing.
#define FORWARD_DELAY 0.01		// random delay
#define NO_DELAY -1.0		// no delay 

// The Routing Agent
class MFlood: public Agent {
	friend class MFlood_RTEntry;

public:
	MFlood(nsaddr_t id);
	void recv(Packet *p, Handler *);

protected:
	int command(int, const char *const *);
	inline int initialized() { return 1 && target_; }

	// Route Table Management
	void rt_resolve(Packet *p);

	// Packet TX Routines
	void forward(MFlood_RTEntry *rt, Packet *p, double delay);

	nsaddr_t index_;                  // IP Address of this node

	// Routing Table
	MFlood_RTable rtable_;

	// A mechanism for logging the contents of the routing
	Trace *logtarget;
	NsObject *uptarget_;
	NsObject *port_dmux_;
  private:
  	u_int32_t myseq_;
};

#endif 

⌨️ 快捷键说明

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