0
votes

I am simulating a Flying Ad Hoc Network using aodv routing protocol. I want to get the list of neighbor's node to send random numbers to these neighbors. I found this code in google omnet++ forum :

#include "IRoutingTable.h"
#include "RoutingTableAccess.h"
        vector<IPAddress> neigh;
        IRoutingTable *inet_rt = RoutingTableAccess().get();
        neigh.clear();
        for (int i=0;i<inet_rt->getNumRoutes(); ++i)
        {
                const IPRoute *e = inet_rt->getRoute(i);
                if (e->getMetric()==1)
                {
                     neigh.push_back(e->getHost());
                }
        }

But when i try to use it, i can't find the file "RoutingTableAccess.h" in the inet directory? Is there any other method to get the list of neighbors in Mobile Ad hod Network using aodv?

Many Thanks.

1

1 Answers

0
votes

Since INET 4.0 every host has the parameter routingTableModule that indicates the name of routing table's module.
The following method may be used to obtain an access to routing table:

IRoutingTable *routingTable;
routingTable = getModuleFromPar<IRoutingTable>(par("routingTableModule"), this);