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

📄 aodv_logs.cc

📁 CBRP协议(移动adhoc中基于分簇的路由协议)ns2下的源码
💻 CC
字号:
/*    aodv_logs.cc   $Id: aodv_logs.cc,v 1.2 1998/11/19 06:23:17 dmaltz Exp $   */#include <aodv/aodv.h>#include <aodv/aodv_packet.h>#include <ip.h>#define CURRENT_TIME    Scheduler::instance().clock()static const int verbose = 0;/* =====================================================================   Logging Functions   ===================================================================== */voidAODV::log_link_del(nsaddr_t dst){        static int link_del = 0;        if(! logtarget || ! verbose) return;        /*         *  If "god" thinks that these two nodes are still         *  reachable then this is an erroneous deletion.         */        sprintf(logtarget->buffer(),                "A %.9f _%d_ deleting LL hop to %d (delete %d is %s)",                CURRENT_TIME,                index,                dst,                ++link_del,                God::instance()->hops(index, dst) != 1 ? "VALID" : "INVALID");        logtarget->dump();}voidAODV::log_link_broke(Packet *p){        static int link_broke = 0;        struct hdr_cmn *ch = HDR_CMN(p);        if(! logtarget || ! verbose) return;        sprintf(logtarget->buffer(),                "A %.9f _%d_ LL unable to deliver packet %d to %d (%d) (reason = %d, ifqlen = %d)",                CURRENT_TIME,                index,                ch->uid_,                ch->next_hop_,                ++link_broke,                ch->xmit_reason_,                ifqueue->length());	logtarget->dump();}voidAODV::log_link_kept(nsaddr_t dst){        static int link_kept = 0;        if(! logtarget || ! verbose) return;        /*         *  If "god" thinks that these two nodes are now         *  unreachable, then we are erroneously keeping         *  a bad route.         */        sprintf(logtarget->buffer(),                "A %.9f _%d_ keeping LL hop to %d (keep %d is %s)",                CURRENT_TIME,                index,                dst,                ++link_kept,                God::instance()->hops(index, dst) == 1 ? "VALID" : "INVALID");        logtarget->dump();}

⌨️ 快捷键说明

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