26 #ifndef RUNetworkConfigurator_H_
27 #define RUNetworkConfigurator_H_
33 #include <ctopology.h>
37 #include "IPAddress.h"
38 #include "RoutingTable.h"
39 #include "InterfaceTable.h"
40 #include "IPAddressResolver.h"
41 #include "NetworkConfigurator.h"
42 #include "IPv4InterfaceData.h"
43 #include "InterfaceEntry.h"
88 module = node->getModule();
90 ift = IPAddressResolver().findInterfaceTableOf(
module);
91 rt = IPAddressResolver().findRoutingTableOf(
module);
94 string fullPath =
module->getFullPath();
98 if ( (index = fullPath.find(
"sas")) != -1 )
100 else if ( (index = fullPath.find(
"tas")) != -1 )
102 else if ( (index = fullPath.find(
"ReaSEUnderlayNetwork")) != -1)
105 cerr <<
"found module that doesn't belong to Transit AS (tas) or Stub AS (sas): "<< fullPath<<endl;
106 opp_error(
"found module that doesn't belong to Transit AS (tas) or Stub AS (sas)");
113 while (isdigit(fullPath[index]) && (index < (
int) fullPath.length()))
114 currentId += fullPath[index++];
115 asId = atoi(currentId.data());
118 if (
module->getProperties()->get(
"CoreRouter"))
120 else if (
module->getProperties()->get(
"GatewayRouter"))
122 else if (
module->getProperties()->get(
"EdgeRouter"))
124 else if (
module->getProperties()->get(
"Host"))
127 cerr<<
"found module without valid type: "<<fullPath<<endl;
128 opp_error(
"found module without valid type");
135 for (
int i=0; i<
ift->getNumInterfaces(); i++)
136 if (!
ift->getInterface(i)->isLoopback())
137 addr =
ift->getInterface(i)->ipv4Data()->getIPAddress();
141 for (
int i=0; i<
ift->getNumInterfaces(); i++) {
142 if (!
ift->getInterface(i)->isLoopback()) {
145 addr =
ift->getInterface(i)->ipv4Data()->getIPAddress();
147 if (
module->gate(
ift->getInterface(i)->getNodeOutputGateId())\
148 ->getNextGate()->getOwnerModule()->getProperties()->get(
"CoreRouter")) {
154 if (
module->gate(
ift->getInterface(i)->getNodeOutputGateId())\
155 ->getNextGate()->getOwnerModule()->getProperties()->get(
"GatewayRouter")) {
160 if (
module->gate(
ift->getInterface(i)->getNodeOutputGateId())\
161 ->getNextGate()->getOwnerModule()->getProperties()->get(
"EdgeRouter")) {
206 this->
module = node->getModule();
210 string fullPath = node->getModule()->getFullPath();
214 if ( (index = fullPath.find(
".sas")) != -1 )
216 else if ( (index = fullPath.find(
".tas")) != -1 )
218 else if ( (index = fullPath.find(
"ReaSEUnderlayNetwork")) != -1 )
222 cerr <<
"found module that doesn't belong to TAS or SAS: "<< fullPath<<endl;
223 opp_error(
"found module that doesn't belong to TAS or SAS");
231 while (isdigit(fullPath[index]) && (index < (
int) fullPath.length()))
232 currentId += fullPath[index++];
233 id = atoi(currentId.data());
328 namespace RUNetConf {
341 static bool getCoreNodes(cModule *curMod,
void *nullPointer);