178 for (
int i = 0; i < topo.getNumNodes(); i++) {
179 cTopology::Node *destNode = topo.getNode(i);
190 IPv6RoutingTable *destRt = L3AddressResolver().findIPv6RoutingTableOf(destNode->getModule());
191 IInterfaceTable *destIft = L3AddressResolver().interfaceTableOf(destNode->getModule());
198 if (!destRt->par(
"isRouter").boolValue())
202 std::vector<const IPv6InterfaceData::AdvPrefix *> destPrefixes;
203 for (
int x = 0; x < destIft->getNumInterfaces(); x++) {
204 InterfaceEntry *destIf = destIft->getInterface(x);
206 if (destIf->isLoopback())
209 for (
int y = 0; y < destIf->ipv6Data()->getNumAdvPrefixes(); y++)
210 if (destIf->ipv6Data()->getAdvPrefix(y).prefix.isGlobal())
211 destPrefixes.push_back(&destIf->ipv6Data()->getAdvPrefix(y));
215 std::string destModName = destNode->getModule()->getFullName();
218 topo.calculateUnweightedSingleShortestPathsTo(destNode);
221 for (
int j = 0; j < topo.getNumNodes(); j++) {
227 cTopology::Node *atNode = topo.getNode(j);
228 if (atNode->getNumPaths() == 0)
231 IPv6RoutingTable *rt = L3AddressResolver().findIPv6RoutingTableOf(atNode->getModule());
232 IInterfaceTable *ift = L3AddressResolver().interfaceTableOf(atNode->getModule());
239 if (!rt->par(
"isRouter").boolValue())
243 cGate *localGate = atNode->getPath(0)->getLocalGate();
244 InterfaceEntry *localIf = ift->getInterfaceByNodeOutputGateId(localGate->getId());
249 cTopology::Node *prevNode = atNode;
252 while (!
isIPNode(prevNode->getPath(0)->getRemoteNode()))
253 prevNode = prevNode->getPath(0)->getRemoteNode();
256 cGate *remoteGate = prevNode->getPath(0)->getRemoteGate();
257 cModule *nextHop = remoteGate->getOwnerModule();
258 IInterfaceTable *nextHopIft = L3AddressResolver().interfaceTableOf(nextHop);
259 InterfaceEntry *nextHopOnlinkIf = nextHopIft->getInterfaceByNodeInputGateId(remoteGate->getId());
262 IPv6Address nextHopLinkLocalAddr = nextHopOnlinkIf->ipv6Data()->getLinkLocalAddress();
266 for (
auto & destPrefixe : destPrefixes) {
267 rt->addStaticRoute(destPrefixe->prefix, destPrefixe->prefixLength,
268 localIf->getInterfaceId(), nextHopLinkLocalAddr);
virtual void setDisplayString(int numIPNodes, int numNonIPNodes)
Definition: FlatNetworkConfigurator6.cc:57
virtual bool isIPNode(cTopology::Node *node)
Definition: FlatNetworkConfigurator6.cc:65