cip.h

来自「运行于linux上的CIMS套件」· C头文件 代码 · 共 68 行

H
68
字号
#ifndef ns_cip_h#define ns_cip_h#include <assert.h>#include "agent.h"#include "classifier-addr.h"#define CIP_TIMER_SIMPLE	0#define CIP_TIMER_AGTLIST	1struct hdr_ipinip {	hdr_ip hdr_;	struct hdr_ipinip *next_;	// XXX multiple encapsulation OK};typedef enum {	CIPT_BEACON} CipRegType;struct hdr_cip {	int haddr_;	int ha_;	int coa_;	CipRegType type_;	double lifetime_;	int seqno_;	int priority_;                     /* JCW */};class SimpleTimer : public TimerHandler {public: 	SimpleTimer(Agent *a) : TimerHandler() { a_ = a; }protected:	inline void expire(Event *) { a_->timeout(CIP_TIMER_SIMPLE); }	Agent *a_;};class CIPBSAgent : public Agent {public:	CIPBSAgent();	virtual void recv(Packet *, Handler *);	void timeout(int);protected:	int command(int argc, const char*const*argv);	void send_ads(int dst = -1, NsObject *target = NULL);	double beacon_; /* beacon period */	NsObject *bcast_target_; /* where to send out ads */	NsObject *ragent_;     /* where to send reg-replies to MH */	SimpleTimer timer_;	int seqno_;		/* current ad seqno */	int priority_;	double adlftm_;	/* ads lifetime */	int off_cip_;};class CIPMHAgent : public Agent {public:        CIPMHAgent();        void recv(Packet *, Handler *);protected:	int off_cip_;        MobileNode *node_;        int  command(int argc, const char*const*argv);};#endif

⌨️ 快捷键说明

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