2
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’
4

1 回答 1

0

复制node.h到目录

ns-allinone-2.35/ns-2.35/common

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

于 2013-03-30T07:02:01.580 回答