fixedrtable.h
来自「ns2.31下的UWB(Ultra WideBand)实现」· C头文件 代码 · 共 63 行
H
63 行
/* * 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 fixed_r_table_h_#define fixed_r_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 fixed_rtable_ent {public: fixed_rtable_ent() { bzero(this, sizeof(fixed_rtable_ent));} nsaddr_t dst; // destination int tag; // tag nsaddr_t hop; // next hop int nic_id; // next hop PacketQueue *q; //pkts queued for dst};// 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 FixedRoutingTable { public: FixedRoutingTable(); void AddEntry(const fixed_rtable_ent &ent); fixed_rtable_ent *GetEntry(nsaddr_t dest, int tag); // for looping over elements int RemainingLoop(); void InitLoop(); fixed_rtable_ent *NextLoop(); private: fixed_rtable_ent *rtab; int maxelts; // for looping over elements int elts; int ctr;}; #endif
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?