?? nhlist.h
字號:
/******************************************************************* Copyright (C) 2004 Thomas Kunz, CRC Canada, BCAST for IPv4. DISTRIBUTED WITH NO WARRANTY, EXPRESS OR IMPLIED. See the GNU Library General Public License (file COPYING in the MANET_multicast directory) for conditions of use and redistribution.*********************************************************************/#ifndef __nhlist_h__#define __nhlist_h_#include <config.h>class nh_entry{ friend class MAODV; friend class mt_entry; friend class nhlist; friend class ODMRP;public: nh_entry(); ~nh_entry(){};protected: nsaddr_t next_hop; u_int8_t enabled_flag;#define NH_DISABLE 0#define NH_ENABLE 1#define NH_DUP 2 u_int8_t link_direction;#define UPSTREAM 0#define DOWNSTREAM 1 nh_entry *next_;};class nhlist {public: nhlist(); ~nhlist(); void add(nh_entry *p); nh_entry* top(); nh_entry* next(nsaddr_t dst); // Returns next hop from the head of the queue. nh_entry* deque(void); // Returns a next hop for destination "D". nh_entry* deque(nsaddr_t dst); nh_entry* find(nsaddr_t dst); //numbers of enabled neighbors int size(); int extrasize(); void disable(); nh_entry* findupstream(); nh_entry* findenabledupstream(); nh_entry* firsthop(); nh_entry* hopexcept(nsaddr_t dst);private: nh_entry* remove_head(); void findNextHopWithDst(nsaddr_t dst, nh_entry*& p, nh_entry*& prev); void verifyList(void); nh_entry* head_; nh_entry* tail_; int len_;};#endif
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -