|
INET Framework for OMNeT++/OMNEST
|
Configuration reader for the OSPF module.
More...
#include <Ospfv2ConfigReader.h>
|
| cPar & | par (const char *name) const |
| |
| int | getIntAttrOrPar (const cXMLElement &ifConfig, const char *name) const |
| |
| bool | getBoolAttrOrPar (const cXMLElement &ifConfig, const char *name) const |
| |
| const char * | getStrAttrOrPar (const cXMLElement &ifConfig, const char *name) const |
| |
| std::vector< NetworkInterface * > | getInterfaceByXMLAttributesOf (const cXMLElement &ifConfig) |
| | Search an NetworkInterface in IInterfaceTable by interface name or toward module name an returns the NetworkInterface pointer or throws an error. More...
|
| |
| cXMLElement * | findMatchingConfig (const cXMLElementList &routerConfig, const NetworkInterface &intf) |
| |
| void | getAreaListFromXML (const cXMLElement &routerNode, std::set< AreaId > &areaList) const |
| | Loads a list of OSPF Areas connected to this router from the config XML. More...
|
| |
| void | loadAreaFromXML (const cXMLElement &asConfig, AreaId areaID) |
| | Loads basic configuration information for a given area from the config XML. More...
|
| |
| void | loadAuthenticationConfig (Ospfv2Interface *intf, const cXMLElement &ifConfig) |
| | Loads authenticationType and authenticationKey attributes for a router interface. More...
|
| |
| void | loadInterfaceParameters (const cXMLElement &ifConfig, NetworkInterface &intf) |
| | Loads OSPF configuration information for a router interface. More...
|
| |
| void | loadExternalRoute (const cXMLElement &externalRouteConfig) |
| | Loads the configuration information of a route outside of the Autonomous System (external route). More...
|
| |
| void | loadHostRoute (const cXMLElement &hostRouteConfig) |
| | Loads the configuration of a host route (a host directly connected to the router). More...
|
| |
| void | loadLoopbackParameters (const cXMLElement &loConfig, NetworkInterface &intf) |
| | Loads the configuration of a loopback interface. More...
|
| |
| void | loadVirtualLink (const cXMLElement &virtualLinkConfig, cXMLElement &asConfig) |
| | Loads the configuration of an OSPf virtual link (virtual connection between two backbone routers). More...
|
| |
| void | initiateDefaultRouteDistribution () |
| | Distributes the configure default route on this router with AS-External LSAs to other OSPF routers. More...
|
| |
| void | joinMulticastGroups (int interfaceId) |
| |
Configuration reader for the OSPF module.
◆ Ospfv2ConfigReader()
| inet::ospfv2::Ospfv2ConfigReader::Ospfv2ConfigReader |
( |
cModule * |
ospfModule, |
|
|
IInterfaceTable * |
ift |
|
) |
| |
◆ ~Ospfv2ConfigReader()
| inet::ospfv2::Ospfv2ConfigReader::~Ospfv2ConfigReader |
( |
| ) |
|
|
virtual |
◆ findMatchingConfig()
| cXMLElement * inet::ospfv2::Ospfv2ConfigReader::findMatchingConfig |
( |
const cXMLElementList & |
routerConfig, |
|
|
const NetworkInterface & |
intf |
|
) |
| |
|
private |
510 for (
auto& ifConfig : routerConfig) {
511 std::string nodeName = ifConfig->getTagName();
512 if ((nodeName ==
"PointToPointInterface") ||
513 (nodeName ==
"BroadcastInterface") ||
514 (nodeName ==
"NBMAInterface") ||
515 (nodeName ==
"PointToMultiPointInterface") ||
516 (nodeName ==
"LoopbackInterface"))
518 const char *ifName = (*ifConfig).getAttribute(
"ifName");
519 if (ifName && *ifName) {
521 if (pattern.matches(intf.getFullName()) ||
522 pattern.matches(intf.getInterfaceFullPath().c_str()) ||
523 pattern.matches(intf.getInterfaceName()))
532 cModule *destnode = getSimulation()->getSystemModule()->getModuleByPath(toward);
534 throw cRuntimeError(
"toward module `%s' not found at %s", toward, (*ifConfig).getSourceLocation());
536 int gateId = intf.getNodeOutputGateId();
537 if ((gateId != -1) &&
ift->
getHostModule()->gate(gateId)->pathContains(destnode))
Referenced by loadConfigFromXML().
◆ getAreaListFromXML()
| void inet::ospfv2::Ospfv2ConfigReader::getAreaListFromXML |
( |
const cXMLElement & |
routerNode, |
|
|
std::set< AreaId > & |
areaList |
|
) |
| const |
|
private |
Loads a list of OSPF Areas connected to this router from the config XML.
- Parameters
-
| routerNode | [in] XML node describing this router. |
| areaList | [out] A set of OSPF Areas connected to this router. |
133 cXMLElementList routerConfig = routerNode.getChildren();
134 for (
auto& elem : routerConfig) {
135 std::string nodeName = (elem)->getTagName();
136 if ((nodeName ==
"PointToPointInterface") ||
137 (nodeName ==
"BroadcastInterface") ||
138 (nodeName ==
"NBMAInterface") ||
139 (nodeName ==
"LoopbackInterface") ||
140 (nodeName ==
"PointToMultiPointInterface"))
144 areaList.insert(areaID);
Referenced by loadConfigFromXML().
◆ getBoolAttrOrPar()
| bool inet::ospfv2::Ospfv2ConfigReader::getBoolAttrOrPar |
( |
const cXMLElement & |
ifConfig, |
|
|
const char * |
name |
|
) |
| const |
|
private |
592 const char *attrStr = ifConfig.getAttribute(name);
593 if (attrStr && *attrStr) {
594 if (strcmp(attrStr,
"true") == 0 || strcmp(attrStr,
"1") == 0)
596 if (strcmp(attrStr,
"false") == 0 || strcmp(attrStr,
"0") == 0)
598 throw cRuntimeError(
"Invalid boolean attribute %s = '%s' at %s", name, attrStr, ifConfig.getSourceLocation());
Referenced by loadConfigFromXML().
◆ getIntAttrOrPar()
| int inet::ospfv2::Ospfv2ConfigReader::getIntAttrOrPar |
( |
const cXMLElement & |
ifConfig, |
|
|
const char * |
name |
|
) |
| const |
|
private |
◆ getInterfaceByXMLAttributesOf()
| std::vector< NetworkInterface * > inet::ospfv2::Ospfv2ConfigReader::getInterfaceByXMLAttributesOf |
( |
const cXMLElement & |
ifConfig | ) |
|
|
private |
Search an NetworkInterface in IInterfaceTable by interface name or toward module name an returns the NetworkInterface pointer or throws an error.
547 std::vector<NetworkInterface *> results;
548 const char *ifName = ifConfig.getAttribute(
"ifName");
549 if (ifName && *ifName) {
553 if (pattern.matches(intf->getFullName()) ||
554 pattern.matches(intf->getInterfaceFullPath().c_str()) ||
555 pattern.matches(intf->getInterfaceName()))
557 results.push_back(intf);
564 cModule *destnode = getSimulation()->getSystemModule()->getModuleByPath(toward);
566 throw cRuntimeError(
"'ifName' or 'toward' module `%s' not found at %s", toward, ifConfig.getSourceLocation());
573 if ((gateId != -1) && (host->gate(gateId)->pathContains(destnode))) {
574 results.push_back(ie);
579 throw cRuntimeError(
"Error reading XML config: IInterfaceTable contains no interface toward '%s' at %s", toward, ifConfig.getSourceLocation());
Referenced by loadExternalRoute(), and loadHostRoute().
◆ getStrAttrOrPar()
| const char * inet::ospfv2::Ospfv2ConfigReader::getStrAttrOrPar |
( |
const cXMLElement & |
ifConfig, |
|
|
const char * |
name |
|
) |
| const |
|
private |
◆ initiateDefaultRouteDistribution()
| void inet::ospfv2::Ospfv2ConfigReader::initiateDefaultRouteDistribution |
( |
| ) |
|
|
private |
Distributes the configure default route on this router with AS-External LSAs to other OSPF routers.
485 EV_DEBUG <<
" distributing the default route. \n";
487 Ipv4AddressRange networkAddress;
490 networkAddress.address = networkAddress.address & networkAddress.mask;
492 Ospfv2AsExternalLsaContents asExternalRoute;
493 asExternalRoute.setNetworkMask(networkAddress.mask);
495 asExternalRoute.setExternalTOSInfoArraySize(1);
496 auto& tosInfo = asExternalRoute.getExternalTOSInfoForUpdate(0);
497 tosInfo.E_ExternalMetricType =
true;
499 tosInfo.externalRouteTag = 0;
501 tosInfo.routeCost = 1;
Referenced by loadConfigFromXML().
◆ joinMulticastGroups()
| void inet::ospfv2::Ospfv2ConfigReader::joinMulticastGroups |
( |
int |
interfaceId | ) |
|
|
private |
◆ loadAreaFromXML()
| void inet::ospfv2::Ospfv2ConfigReader::loadAreaFromXML |
( |
const cXMLElement & |
asConfig, |
|
|
AreaId |
areaID |
|
) |
| |
|
private |
Loads basic configuration information for a given area from the config XML.
Reads the configured address ranges, and whether this Area should be handled as a stub Area.
151 std::string areaXPath(
"Area[@id='");
152 areaXPath += areaID.str(
false);
157 cXMLElement *areaConfig = asConfig.getElementByPath(areaXPath.c_str());
158 if (areaConfig ==
nullptr) {
159 if (areaID != Ipv4Address(
"0.0.0.0"))
160 throw cRuntimeError(
"No configuration for Area ID: %s at %s", areaID.str(
false).c_str(), asConfig.getSourceLocation());
161 Ospfv2Area *area =
new Ospfv2Area(crcMode,
ift, areaID);
167 EV_DEBUG <<
" loading info for Area id = " << areaID.str(
false) <<
"\n";
169 Ospfv2Area *area =
new Ospfv2Area(crcMode,
ift, areaID);
171 cXMLElementList areaDetails = areaConfig->getChildren();
172 for (
auto& areaDetail : areaDetails) {
173 std::string nodeName = (areaDetail)->getTagName();
174 if (nodeName ==
"AddressRange") {
175 Ipv4AddressRange addressRange;
178 addressRange.address = addressRange.address & addressRange.mask;
179 const char *adv = areaDetail->getAttribute(
"advertise");
181 area->addAddressRange(addressRange,
true);
183 area->addAddressRange(addressRange, std::string(adv) ==
"true");
185 else if (nodeName ==
"Stub") {
187 throw cRuntimeError(
"The backbone cannot be configured as a stub at %s", (areaDetail)->getSourceLocation());
188 area->setExternalRoutingCapability(
false);
192 throw cRuntimeError(
"Invalid node '%s' at %s", nodeName.c_str(), (areaDetail)->getSourceLocation());
Referenced by loadConfigFromXML(), and loadVirtualLink().
◆ loadAuthenticationConfig()
| void inet::ospfv2::Ospfv2ConfigReader::loadAuthenticationConfig |
( |
Ospfv2Interface * |
intf, |
|
|
const cXMLElement & |
ifConfig |
|
) |
| |
|
private |
Loads authenticationType and authenticationKey attributes for a router interface.
458 std::string authenticationType =
getStrAttrOrPar(ifConfig,
"authenticationType");
459 if (authenticationType ==
"SimplePasswordType")
461 else if (authenticationType ==
"CrytographicType")
463 else if (authenticationType ==
"NullType")
466 throw cRuntimeError(
"Invalid AuthenticationType '%s' at %s", authenticationType.c_str(), ifConfig.getSourceLocation());
469 AuthenticationKeyType keyValue;
470 memset(keyValue.bytes, 0,
sizeof(keyValue.bytes));
471 int keyLength = key.length();
472 if ((keyLength > 4) && (keyLength <= 18) && (keyLength % 2 == 0) && (key[0] ==
'0') && (key[1] ==
'x')) {
473 for (
int i = keyLength; (i > 2); i -= 2) {
474 keyValue.bytes[(i - 2) / 2 - 1] =
hexPairToByte(key[i - 1], key[i]);
477 intf->setAuthenticationKey(keyValue);
Referenced by loadInterfaceParameters(), and loadVirtualLink().
◆ loadConfigFromXML()
| bool inet::ospfv2::Ospfv2ConfigReader::loadConfigFromXML |
( |
cXMLElement * |
asConfig, |
|
|
Router * |
ospfRouter |
|
) |
| |
Loads the configuration of the OSPF data structure from the config XML.
Returns true if the configuration was successfully loaded.
48 if (strcmp(asConfig->getTagName(),
"OSPFASConfig"))
49 throw cRuntimeError(
"Cannot read OSPF configuration, unexpected element '%s' at %s", asConfig->getTagName(), asConfig->getSourceLocation());
53 std::string nodeFullPath = myNode->getFullPath();
54 std::string nodeShortenedFullPath = nodeFullPath.substr(nodeFullPath.find(
'.') + 1);
57 cXMLElementList routers = asConfig->getElementsByTagName(
"Router");
58 cXMLElement *routerNode =
nullptr;
59 for (
auto& router : routers) {
62 if (pattern.matches(nodeFullPath.c_str()) || pattern.matches(nodeShortenedFullPath.c_str())) {
67 if (routerNode ==
nullptr) {
68 throw cRuntimeError(
"No configuration for Router '%s' at '%s'", nodeFullPath.c_str(), asConfig->getSourceLocation());
71 EV_DEBUG <<
"Ospfv2ConfigReader: Loading info for Router " << nodeFullPath <<
"\n";
76 std::set<AreaId> areaList;
80 for (
const auto& elem : areaList) {
84 cXMLElementList routerConfig = routerNode->getChildren();
91 if (intf->isLoopback())
99 for (
auto& elem : routerConfig) {
100 std::string nodeName = elem->getTagName();
101 if ((nodeName ==
"PointToPointInterface") ||
102 (nodeName ==
"BroadcastInterface") ||
103 (nodeName ==
"NBMAInterface") ||
104 (nodeName ==
"PointToMultiPointInterface") ||
105 (nodeName ==
"LoopbackInterface"))
109 else if (nodeName ==
"ExternalInterface") {
112 else if (nodeName ==
"HostInterface") {
115 else if (nodeName ==
"VirtualLink") {
119 throw cRuntimeError(
"Invalid '%s' node in Router '%s' at %s",
120 nodeName.c_str(), nodeFullPath.c_str(), elem->getSourceLocation());
124 bool DistributeDefaultRoute =
getBoolAttrOrPar(*routerNode,
"DistributeDefaultRoute");
125 if (DistributeDefaultRoute)
Referenced by inet::ospfv2::Ospfv2::createOspfRouter().
◆ loadExternalRoute()
| void inet::ospfv2::Ospfv2ConfigReader::loadExternalRoute |
( |
const cXMLElement & |
externalRouteConfig | ) |
|
|
private |
Loads the configuration information of a route outside of the Autonomous System (external route).
311 Ospfv2AsExternalLsaContents asExternalRoute;
312 Ipv4AddressRange networkAddress;
313 int ifIndex = ie->getInterfaceId();
315 EV_DEBUG <<
" loading ExternalInterface " << ie->getInterfaceName() <<
" ifIndex[" << ifIndex <<
"]\n";
321 networkAddress.address = networkAddress.address & networkAddress.mask;
322 asExternalRoute.setNetworkMask(networkAddress.mask);
323 asExternalRoute.setExternalTOSInfoArraySize(1);
324 auto& tosInfo = asExternalRoute.getExternalTOSInfoForUpdate(0);
326 int routeCost =
getIntAttrOrPar(externalRouteConfig,
"externalInterfaceOutputCost");
328 tosInfo.routeCost = routeCost;
330 std::string metricType =
getStrAttrOrPar(externalRouteConfig,
"externalInterfaceOutputType");
331 if (metricType ==
"Type1")
332 tosInfo.E_ExternalMetricType =
false;
333 else if (metricType ==
"Type2")
334 tosInfo.E_ExternalMetricType =
true;
336 throw cRuntimeError(
"Invalid 'externalInterfaceOutputType' at interface '%s' at '%s'", ie->getInterfaceName(), externalRouteConfig.getSourceLocation());
340 long externalRouteTagVal = 0;
341 const char *externalRouteTag = externalRouteConfig.getAttribute(
"externalRouteTag");
342 if (externalRouteTag && *externalRouteTag) {
343 char *endp =
nullptr;
344 externalRouteTagVal = strtol(externalRouteTag, &endp, 0);
346 throw cRuntimeError(
"Invalid externalRouteTag='%s' at %s", externalRouteTag, externalRouteConfig.getSourceLocation());
348 tosInfo.externalRouteTag = externalRouteTagVal;
Referenced by loadConfigFromXML().
◆ loadHostRoute()
| void inet::ospfv2::Ospfv2ConfigReader::loadHostRoute |
( |
const cXMLElement & |
hostRouteConfig | ) |
|
|
private |
Loads the configuration of a host route (a host directly connected to the router).
357 std::string intfModeStr =
getStrAttrOrPar(hostRouteConfig,
"interfaceMode");
358 if (intfModeStr ==
"NoOSPF")
361 HostRouteParameters hostParameters;
365 int ifIndex = ie->getInterfaceId();
367 hostParameters.ifIndex = ifIndex;
369 EV_DEBUG <<
" loading HostInterface " << ie->getInterfaceName() <<
" ifIndex[" << ifIndex <<
"]\n";
375 hostParameters.linkCost =
getIntAttrOrPar(hostRouteConfig,
"linkCost");
379 if (area !=
nullptr) {
383 throw cRuntimeError(
"Loading HostInterface '%s' aborted, unknown area %s at %s", ie->getInterfaceName(), hostArea.str(
false).c_str(), hostRouteConfig.getSourceLocation());
Referenced by loadConfigFromXML().
◆ loadInterfaceParameters()
| void inet::ospfv2::Ospfv2ConfigReader::loadInterfaceParameters |
( |
const cXMLElement & |
ifConfig, |
|
|
NetworkInterface & |
intf |
|
) |
| |
|
private |
Loads OSPF configuration information for a router interface.
Handles POINTTOPOINT, BROADCAST, NBMA and POINTTOMULTIPOINT interfaces.
201 if (intfModeStr ==
"NoOSPF")
204 std::string interfaceType = ifConfig.getTagName();
205 int ifIndex = ie.getInterfaceId();
206 std::string ifName = ie.getInterfaceName();
208 EV_DEBUG <<
" loading " << interfaceType <<
" " << ifName <<
" (ifIndex=" << ifIndex <<
")\n";
210 Ospfv2Interface *intf =
new Ospfv2Interface;
212 intf->setInterfaceName(ifName);
214 intf->setAreaId(areaID);
215 intf->setIfIndex(
ift, ifIndex);
217 if (interfaceType ==
"PointToPointInterface")
219 else if (interfaceType ==
"BroadcastInterface")
221 else if (interfaceType ==
"NBMAInterface")
223 else if (interfaceType ==
"PointToMultiPointInterface")
227 throw cRuntimeError(
"Unknown interface type '%s' for interface %s (ifIndex=%d) at %s",
228 interfaceType.c_str(), ifName.c_str(), ifIndex, ifConfig.getSourceLocation());
231 if (intfModeStr ==
"Active")
233 else if (intfModeStr ==
"Passive")
237 throw cRuntimeError(
"Unknown interface mode '%s' for interface %s (ifIndex=%d) at %s",
238 interfaceType.c_str(), ifName.c_str(), ifIndex, ifConfig.getSourceLocation());
245 intf->setOutputCost(
round(
par(
"referenceBandwidth").intValue() / ie.getDatarate()));
247 intf->setOutputCost(cost);
249 intf->setRetransmissionInterval(
getIntAttrOrPar(ifConfig,
"retransmissionInterval"));
251 intf->setTransmissionDelay(
getIntAttrOrPar(ifConfig,
"interfaceTransmissionDelay"));
253 if (interfaceType ==
"BroadcastInterface" || interfaceType ==
"NBMAInterface")
258 intf->setRouterDeadInterval(
getIntAttrOrPar(ifConfig,
"routerDeadInterval"));
262 if (interfaceType ==
"NBMAInterface")
265 cXMLElementList ifDetails = ifConfig.getChildren();
267 for (
auto& ifDetail : ifDetails) {
268 std::string nodeName = (ifDetail)->getTagName();
269 if ((interfaceType ==
"NBMAInterface") && (nodeName ==
"NBMANeighborList")) {
270 cXMLElementList neighborList = (ifDetail)->getChildren();
271 for (
auto& elem : neighborList) {
272 std::string neighborNodeName = (elem)->getTagName();
273 if (neighborNodeName ==
"NBMANeighbor") {
274 Neighbor *neighbor =
new Neighbor;
277 intf->addNeighbor(neighbor);
281 if ((interfaceType ==
"PointToMultiPointInterface") && (nodeName ==
"PointToMultiPointNeighborList")) {
282 cXMLElementList neighborList = (ifDetail)->getChildren();
283 for (
auto& elem : neighborList) {
284 std::string neighborNodeName = (elem)->getTagName();
285 if (neighborNodeName ==
"PointToMultiPointNeighbor") {
286 Neighbor *neighbor =
new Neighbor;
288 intf->addNeighbor(neighbor);
298 if (area !=
nullptr) {
304 throw cRuntimeError(
"Loading %s ifIndex[%d] in Area %s aborted at %s", interfaceType.c_str(), ifIndex, areaID.str(
false).c_str(), ifConfig.getSourceLocation());
Referenced by loadConfigFromXML().
◆ loadLoopbackParameters()
| void inet::ospfv2::Ospfv2ConfigReader::loadLoopbackParameters |
( |
const cXMLElement & |
loConfig, |
|
|
NetworkInterface & |
intf |
|
) |
| |
|
private |
Loads the configuration of a loopback interface.
390 int ifIndex = ie.getInterfaceId();
391 EV_DEBUG <<
" loading LoopbackInterface " << ie.getInterfaceName() <<
" ifIndex[" << ifIndex <<
"]\n";
396 HostRouteParameters hostParameters;
397 hostParameters.ifIndex = ifIndex;
399 hostParameters.address = ie.getIpv4Address();
407 throw cRuntimeError(
"Loading LoopbackInterface '%s' aborted, unknown area %s at %s", ie.getInterfaceName(), hostArea.str(
false).c_str(), loConfig.getSourceLocation());
Referenced by loadConfigFromXML().
◆ loadVirtualLink()
| void inet::ospfv2::Ospfv2ConfigReader::loadVirtualLink |
( |
const cXMLElement & |
virtualLinkConfig, |
|
|
cXMLElement & |
asConfig |
|
) |
| |
|
private |
Loads the configuration of an OSPf virtual link (virtual connection between two backbone routers).
415 EV_DEBUG <<
" loading VirtualLink to OSPF router " << routerId.str(
false) <<
"\n";
417 Neighbor *neighbor =
new Neighbor;
418 neighbor->setNeighborID(routerId);
420 Ospfv2Interface *intf =
new Ospfv2Interface;
423 intf->setInterfaceName(
"virtual");
424 intf->addNeighbor(neighbor);
426 intf->setRetransmissionInterval(
getIntAttrOrPar(virtualLinkConfig,
"retransmissionInterval"));
427 intf->setTransmissionDelay(
getIntAttrOrPar(virtualLinkConfig,
"interfaceTransmissionDelay"));
428 intf->setHelloInterval(
getIntAttrOrPar(virtualLinkConfig,
"helloInterval"));
429 intf->setRouterDeadInterval(
getIntAttrOrPar(virtualLinkConfig,
"routerDeadInterval"));
431 const char *ospfCrcMode =
par(
"crcMode");
436 AreaId transitAreaId = intf->getTransitAreaId();
440 throw cRuntimeError(
"Virtual link to router %s cannot be configured through a non-existence transit area '%s' at %s", routerId.str(
false).c_str(), transitAreaId.str(
false).c_str(), virtualLinkConfig.getSourceLocation());
442 else if (!transitArea->getExternalRoutingCapability()) {
444 throw cRuntimeError(
"Virtual link to router %s cannot be configured through a stub area '%s' at %s", routerId.str(
false).c_str(), transitAreaId.str(
false).c_str(), virtualLinkConfig.getSourceLocation());
Referenced by loadConfigFromXML().
◆ par()
| cPar& inet::ospfv2::Ospfv2ConfigReader::par |
( |
const char * |
name | ) |
const |
|
inlineprivate |
◆ ift
◆ ospfModule
| cModule* inet::ospfv2::Ospfv2ConfigReader::ospfModule = nullptr |
|
private |
◆ ospfRouter
| Router* inet::ospfv2::Ospfv2ConfigReader::ospfRouter = nullptr |
|
private |
The documentation for this class was generated from the following files:
cModule * findContainingNode(const cModule *from)
Find the node containing the given module.
Definition: ModuleAccess.cc:31
void addHostRoute(HostRouteParameters &hostRouteParameters)
Definition: Ospfv2Area.h:57
@ POINTTOPOINT
Definition: Ospfv2Interface.h:32
void getAreaListFromXML(const cXMLElement &routerNode, std::set< AreaId > &areaList) const
Loads a list of OSPF Areas connected to this router from the config XML.
Definition: Ospfv2ConfigReader.cc:131
void setRFC1583Compatibility(bool compatibility)
Definition: Ospfv2Router.h:61
unsigned long Metric
Definition: Ospfv2Common.h:56
cXMLElement * findMatchingConfig(const cXMLElementList &routerConfig, const NetworkInterface &intf)
Definition: Ospfv2ConfigReader.cc:508
@ INTERFACE_UP
Definition: Ospfv2Interface.h:40
cPar & par(const char *name) const
Definition: Ospfv2ConfigReader.h:32
const char * getStrAttrOrPar(const cXMLElement &ifConfig, const char *name) const
Definition: Ospfv2ConfigReader.cc:603
Ipv4Route * getDefaultRoute()
get the default route in the routing table.
Definition: Ospfv2Router.cc:1346
Ipv4Address ipv4AddressFromAddressString(const char *charForm)
Definition: Ospfv2Common.h:197
cModule * ospfModule
Definition: Ospfv2ConfigReader.h:27
CrcMode parseCrcMode(const char *crcModeString, bool allowDisable)
Definition: CrcMode.cc:14
void loadHostRoute(const cXMLElement &hostRouteConfig)
Loads the configuration of a host route (a host directly connected to the router).
Definition: Ospfv2ConfigReader.cc:355
@ ACTIVE
Definition: Ospfv2Interface.h:62
virtual NetworkInterface * getInterfaceById(int id) const =0
Returns an interface by its Id.
int getIntAttrOrPar(const cXMLElement &ifConfig, const char *name) const
Definition: Ospfv2ConfigReader.cc:582
@ NULL_TYPE
Definition: Ospfv2Common.h:59
char hexPairToByte(char upperHex, char lowerHex)
Definition: Ospfv2Common.h:282
void loadLoopbackParameters(const cXMLElement &loConfig, NetworkInterface &intf)
Loads the configuration of a loopback interface.
Definition: Ospfv2ConfigReader.cc:388
@ SIMPLE_PASSWORD_TYPE
Definition: Ospfv2Common.h:60
const AreaId BACKBONE_AREAID(0, 0, 0, 0)
Ospfv2Area * getAreaByID(AreaId areaID)
Returns the pointer to the Area identified by the input areaID, if it's on the Area list,...
Definition: Ospfv2Router.cc:63
bool getBoolAttrOrPar(const cXMLElement &ifConfig, const char *name) const
Definition: Ospfv2ConfigReader.cc:590
void addArea(Ospfv2Area *area)
Adds a new Area to the Area list.
Definition: Ospfv2Router.cc:56
@ VIRTUAL
Definition: Ospfv2Interface.h:36
void updateExternalRoute(Ipv4Address networkAddress, const Ospfv2AsExternalLsaContents &externalRouteContents, int ifIndex=-1)
Stores information on an AS External Route in externalRoutes and intalls(or updates) a new AsExternal...
Definition: Ospfv2Router.cc:1356
virtual cModule * getHostModule() const =0
Returns the host or router this interface table lives in.
static const Ipv4Address ALL_OSPF_DESIGNATED_ROUTERS_MCAST
224.0.0.6 All OSPF Designated Routers
Definition: Ipv4Address.h:100
bool contains(const std::vector< T > &v, const Tk &a)
Definition: stlutils.h:65
void loadAreaFromXML(const cXMLElement &asConfig, AreaId areaID)
Loads basic configuration information for a given area from the config XML.
Definition: Ospfv2ConfigReader.cc:149
IInterfaceTable * ift
Definition: Ospfv2ConfigReader.h:28
@ NBMA
Definition: Ospfv2Interface.h:34
@ PASSIVE
Definition: Ospfv2Interface.h:63
int round(double d)
Returns an integer that corresponds to rounded double parameter.
Definition: INETMath.h:143
@ POINTTOMULTIPOINT
Definition: Ospfv2Interface.h:35
void initiateDefaultRouteDistribution()
Distributes the configure default route on this router with AS-External LSAs to other OSPF routers.
Definition: Ospfv2ConfigReader.cc:480
int getNodeOutputGateId() const
Definition: NetworkInterface.h:234
@ CRYTOGRAPHIC_TYPE
Definition: Ospfv2Common.h:61
virtual int getNumInterfaces() const =0
Returns the number of interfaces.
Router * ospfRouter
Definition: Ospfv2ConfigReader.h:29
void joinMulticastGroups(int interfaceId)
Definition: Ospfv2ConfigReader.cc:611
void addInterface(Ospfv2Interface *intf)
Definition: Ospfv2Area.cc:58
Ipv4Address ipv4NetmaskFromAddressString(const char *charForm)
Definition: Ospfv2Common.h:202
virtual NetworkInterface * getInterface(int pos) const =0
Returns the NetworkInterface specified by an index 0..numInterfaces-1.
@ BROADCAST
Definition: Ospfv2Interface.h:33
Glob-style pattern matching class, adopted to special OMNeT++ requirements.
Definition: PatternMatcher.h:69
Ipv4Address AreaId
Definition: Ospfv2Common.h:130
void loadVirtualLink(const cXMLElement &virtualLinkConfig, cXMLElement &asConfig)
Loads the configuration of an OSPf virtual link (virtual connection between two backbone routers).
Definition: Ospfv2ConfigReader.cc:410
std::vector< NetworkInterface * > getInterfaceByXMLAttributesOf(const cXMLElement &ifConfig)
Search an NetworkInterface in IInterfaceTable by interface name or toward module name an returns the ...
Definition: Ospfv2ConfigReader.cc:545
void loadExternalRoute(const cXMLElement &externalRouteConfig)
Loads the configuration information of a route outside of the Autonomous System (external route).
Definition: Ospfv2ConfigReader.cc:308
void loadAuthenticationConfig(Ospfv2Interface *intf, const cXMLElement &ifConfig)
Loads authenticationType and authenticationKey attributes for a router interface.
Definition: Ospfv2ConfigReader.cc:456
void loadInterfaceParameters(const cXMLElement &ifConfig, NetworkInterface &intf)
Loads OSPF configuration information for a router interface.
Definition: Ospfv2ConfigReader.cc:198
const char * getMandatoryFilledAttribute(const cXMLElement &node, const char *attr)
Definition: XMLUtils.cc:160
static const Ipv4Address ALL_OSPF_ROUTERS_MCAST
224.0.0.5 All OSPF routers (DR Others)
Definition: Ipv4Address.h:99