MAODV:没有成员的名字

时间:2013-03-29 18:39:29

标签: c++ ns2

void AODV::rt_resolve(Packet *p) {
    struct hdr_cmn *ch = HDR_CMN(p);
    struct hdr_ip *ih = HDR_IP(p);
    aodv_rt_entry *rt;
    ch->xmit_failure_ = aodv_rt_failed_callback;
    ch->xmit_failure_data_ = (void*) this;
    rt = rtable.rt_lookup(ih->daddr());

    if(rt == 0) {
      rt = rtable.rt_add(ih->daddr());
    }

    if(rt->rt_flags == RTF_UP) {
       assert(rt->rt_hops != INFINITY2);
     #ifdef PREDICTION
        double breakTime = 2000.0;
        if (ch->num_forwards() != 0 && ch->next_hop_ == index){
        Node *currentNode = Node::get_node_by_address(index);
        breakTime = currentNode->getTime(ch->prev_hop_);

     if (breakTime < 2000.0 && breakTime > CURRENT_TIME 
      && (breakTime - CURRENT_TIME < PREDICTION_TIME_FOR_UNICAST) 
      && (rt->rt_prevnode_warning == 0)){              
        //printf("\nPREDICTION:: at %.9f on node %d prev node %d , dst %d, will break at %.9f\n", CURRENT_TIME, index, ch->prev_hop_, ih->daddr(), breakTime); 
        sendLPW(ch->prev_hop_, breakTime);
        rt->rt_prevnode_warning ++;
    }
}
#endif
forward(rt, p, NO_DELAY);
}

在上面的MAODV代码中我收到了以下错误

In member function ‘void AODV::rt_resolve(Packet*)’:
 aodv/aodv.cc:569:34: error: ‘class Node’ has no member named ‘getTime’

1 个答案:

答案 0 :(得分:0)

node.h复制到目录

  

NS-ALLINONE-2.35 / NS-2.35 /通用

由于函数是在MAODV代码的“node.h”中定义的,而不是在已经存在的简单“node.h”中定义的。