arandomuser
arandomuser

Reputation: 571

omnet++ retrieve network topology from code

I'm very new to OMNeT++ and I'm writing my first simulation with it. What I'm trying to do is to retrieve the complete topology of the network at execution time from a node.

Basically, I have a router node that needs to know the entire topology (which node is connect to who) but I don't want to statically change the C++ code according to the Network selected. Instead, the idea is that the router is able in its initialization function to discover all the connections between nodes.

How can I do that?

Thanks in advance.

Upvotes: 0

Views: 599

Answers (1)

Rudi
Rudi

Reputation: 6681

What you need is the omnetpp::cTopology class from the OMNeT++ API: https://omnetpp.org/doc/omnetpp/api/classomnetpp_1_1cTopology.html

If you are using INET, there is a slightly enhanced version of this class in inet::common::Topology

Upvotes: 1

Related Questions