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-アリノン-2.35/ns-2.35/共通

関数はMAODVコードの「node.h」で定義されていますが、すでに存在する単純な「node.h」では定義されていません。

于 2013-03-30T07:02:01.580 に答える