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

📄 mflood-seqtable.h

📁 mflood协议在ns2中的实现
💻 H
字号:
#ifndef __mflood_rtable_h__

#define __mflood_rtable_h__



#include <assert.h>

#include <sys/types.h>

#include <config.h>

#include <lib/bsd-list.h>

#include <scheduler.h>



#define INFINITY2        0xff

#define RTF_DOWN 0

#define RTF_UP 1

#define REM_SEQ_COUNT 1000



class MFlood_RTEntry{

    friend class MFlood_RTable;

    friend class MFlood;

public:

    MFlood_RTEntry();

    MFlood_RTEntry(nsaddr_t src, u_int32_t seq);

    bool isNewSeq(u_int32_t seq);

    void addSeq(u_int32_t seq);

protected:

    LIST_ENTRY(MFlood_RTEntry) rt_link;

    nsaddr_t        src_;

    u_int32_t rt_seqnos[REM_SEQ_COUNT];

    u_int32_t max_seqno;

    u_int32_t min_seqno;

    u_int16_t seq_it;

};



class MFlood_RTable{

   friend class MFlood;

public:

   MFlood_RTable(){LIST_INIT(&rthead);}

   void rt_delete(nsaddr_t id);

   MFlood_RTEntry* rt_lookup(nsaddr_t id);

   void rt_print();

private:

   LIST_HEAD(MFlood_rthead, MFlood_RTEntry) rthead;

};



#endif


⌨️ 快捷键说明

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