tagtable.h

来自「NS中如何添加MANUAL路由协议」· C头文件 代码 · 共 64 行

H
64
字号
/* * Copyright (c) 2004, Stony Brook University * Contributors: Ashish Raniwala * All rights reserved. * * See copyright notice included in the distribution for details * */// raniwala: added for manual routing in wireless scenario//#ifndef tag_table_h_#define tag_table_h_#include "config.h"#include "scheduler.h"#include "queue.h"#ifndef uinttypedef unsigned int uint;#endif // !uint/* NOTE: we depend on bzero setting the booleans to ``false''   but if false != 0, so many things are screwed up, I don't   know what to say... */class tag_table_ent {public:  tag_table_ent() { bzero(this, sizeof(tag_table_ent));}  nsaddr_t     dst;     // destination  int          tag;     // tag  int	     count;     // Number of times this tag is in use};// AddEntry adds an entry to the routing table with metric ent->metric+em.//   You get to free the goods.//// GetEntry gets the entry for an address.class TagTable {  public:    TagTable();    void AddTag(const tag_table_ent &ent);    tag_table_ent *GetTag(nsaddr_t dest);    void IncreaseTagCount(int tag);    void DecreaseTagCount(int tag);    void ResetTagCount(int tag);    // for looping over elements    int RemainingLoop();    void InitLoop();    tag_table_ent *NextLoop();  private:    tag_table_ent *_rtab;    int         _maxelts;    // for looping over elements    int         _elts;    int         _ctr;};    #endif

⌨️ 快捷键说明

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