|
INET Framework for OMNeT++/OMNEST
|
#include <EigrpDeviceConfigurator.h>
|
| static bool | Str2Int (int *retValue, const char *str) |
| |
| static bool | Str2Bool (bool *ret, const char *str) |
| |
| static cXMLElement * | GetInterface (cXMLElement *iface, cXMLElement *device) |
| |
| static cXMLElement * | GetIPv6Address (cXMLElement *addr, cXMLElement *iface) |
| |
| static const char * | GetNodeParamConfig (cXMLElement *node, const char *paramName, const char *defaultValue) |
| |
| static const char * | GetNodeAttrConfig (cXMLElement *node, const char *attrName, const char *defaultValue) |
| |
| static cXMLElement * | GetEigrpProcess (cXMLElement *process, cXMLElement *device) |
| |
| static cXMLElement * | GetEigrpIPv4Network (cXMLElement *network, cXMLElement *process) |
| |
| static cXMLElement * | GetEigrpProcess6 (cXMLElement *process, cXMLElement *device) |
| |
|
| EigrpNetwork< Ipv4Address > * | isEigrpInterface (std::vector< EigrpNetwork< Ipv4Address > * > &networks, NetworkInterface *interface) |
| | < Gets interfaces that correspond to the IP address and mask More...
|
| |
| bool | wildcardToMask (const char *wildcard, Ipv4Address &result) |
| | Loads configuration of EIGRP process. More...
|
| |
| void | loadEigrpProcessesConfig (cXMLElement *device, IEigrpModule< Ipv4Address > *eigrpModule) |
| | Loads configuration of interfaces for EIGRP. More...
|
| |
| void | loadEigrpInterfacesConfig (cXMLElement *device, IEigrpModule< Ipv4Address > *eigrpModule) |
| | Loads parameters of interfaces for EIGRP. More...
|
| |
| bool | loadEigrpInterfaceParams (cXMLElement *eigrpIface, IEigrpModule< Ipv4Address > *eigrpModule, int ifaceId, const char *ifaceName) |
| |
| void | loadEigrpInterface (cXMLElement *eigrpIface, IEigrpModule< Ipv4Address > *eigrpModule, int ifaceId, const char *ifaceName) |
| | Loads networks added to EIGRP. More...
|
| |
| void | loadEigrpIPv4Networks (cXMLElement *processElem, IEigrpModule< Ipv4Address > *eigrpModule) |
| | Loads K-value and converts it to number. More...
|
| |
| int | loadEigrpKValue (cXMLElement *node, const char *attrName, const char *attrValue) |
| | Loads stub configuration. More...
|
| |
| bool | loadEigrpStubConf (cXMLElement *node, const char *attrName) |
| | Loads configuration of EIGRP IPv6 process. More...
|
| |
| void | loadEigrpProcesses6Config (cXMLElement *device, IEigrpModule< Ipv6Address > *eigrpModule) |
| | Loads configuration of interfaces for EIGRP IPv6. More...
|
| |
| void | loadEigrpInterfaces6Config (cXMLElement *device, IEigrpModule< Ipv6Address > *eigrpModule) |
| | Loads parameters of interfaces for EIGRP. More...
|
| |
| bool | loadEigrpInterfaceParams6 (cXMLElement *eigrpIface, IEigrpModule< Ipv6Address > *eigrpModule, int ifaceId, const char *ifaceName) |
| | Loads interfaces for EIGRP IPv6. More...
|
| |
| void | loadEigrpInterface6 (cXMLElement *eigrpIface, IEigrpModule< Ipv6Address > *eigrpModule, int ifaceId, const char *ifaceName) |
| |
◆ EigrpDeviceConfigurator() [1/2]
| inet::eigrp::EigrpDeviceConfigurator::EigrpDeviceConfigurator |
( |
| ) |
|
◆ EigrpDeviceConfigurator() [2/2]
| inet::eigrp::EigrpDeviceConfigurator::EigrpDeviceConfigurator |
( |
cXMLElement * |
confFile, |
|
|
IInterfaceTable * |
intf |
|
) |
| |
◆ ~EigrpDeviceConfigurator()
| inet::eigrp::EigrpDeviceConfigurator::~EigrpDeviceConfigurator |
( |
| ) |
|
|
virtual |
◆ GetEigrpIPv4Network()
| cXMLElement * inet::eigrp::EigrpDeviceConfigurator::GetEigrpIPv4Network |
( |
cXMLElement * |
network, |
|
|
cXMLElement * |
process |
|
) |
| |
|
static |
835 if (process !=
nullptr) {
837 network = process->getFirstChildWithTag(
"Network");
841 else if (network !=
nullptr) {
842 network = network->getNextSiblingWithTag(
"Network");
Referenced by loadEigrpIPv4Networks().
◆ GetEigrpProcess()
| cXMLElement * inet::eigrp::EigrpDeviceConfigurator::GetEigrpProcess |
( |
cXMLElement * |
process, |
|
|
cXMLElement * |
device |
|
) |
| |
|
static |
808 cXMLElement *routing =
device->getFirstChildWithTag(
"Routing");
810 if (routing ==
nullptr) {
814 cXMLElement *eigrp = routing->getFirstChildWithTag(
"EIGRP");
815 if (eigrp ==
nullptr) {
819 process = eigrp->getFirstChildWithTag(
"ProcessIPv4");
823 else if (process !=
nullptr) {
824 process = process->getNextSiblingWithTag(
"ProcessIPv4");
Referenced by loadEigrpProcessesConfig().
◆ GetEigrpProcess6()
| cXMLElement * inet::eigrp::EigrpDeviceConfigurator::GetEigrpProcess6 |
( |
cXMLElement * |
process, |
|
|
cXMLElement * |
device |
|
) |
| |
|
static |
754 cXMLElement *routing =
device->getFirstChildWithTag(
"Routing6");
755 if (routing ==
nullptr) {
759 cXMLElement *eigrp = routing->getFirstChildWithTag(
"EIGRP");
760 if (eigrp ==
nullptr) {
764 process = eigrp->getFirstChildWithTag(
"ProcessIPv6");
768 else if (process !=
nullptr) {
769 process = process->getNextSiblingWithTag(
"ProcessIPv6");
Referenced by loadEigrpProcesses6Config().
◆ GetInterface()
| cXMLElement * inet::eigrp::EigrpDeviceConfigurator::GetInterface |
( |
cXMLElement * |
iface, |
|
|
cXMLElement * |
device |
|
) |
| |
|
static |
48 cXMLElement *ifaces =
device->getFirstChildWithTag(
"Interfaces");
49 if (ifaces ==
nullptr)
52 iface = ifaces->getFirstChildWithTag(
"Interface");
56 else if (iface !=
nullptr) {
57 iface = iface->getNextSiblingWithTag(
"Interface");
Referenced by loadEigrpInterfaces6Config(), and loadEigrpInterfacesConfig().
◆ GetIPv6Address()
| cXMLElement * inet::eigrp::EigrpDeviceConfigurator::GetIPv6Address |
( |
cXMLElement * |
addr, |
|
|
cXMLElement * |
iface |
|
) |
| |
|
static |
69 if (iface !=
nullptr) {
70 addr = iface->getFirstChildWithTag(
"IPv6Address");
74 else if (addr !=
nullptr) {
75 addr = addr->getNextSiblingWithTag(
"IPv6Address");
Referenced by loadEigrpInterfaces6Config().
◆ GetNodeAttrConfig()
| const char * inet::eigrp::EigrpDeviceConfigurator::GetNodeAttrConfig |
( |
cXMLElement * |
node, |
|
|
const char * |
attrName, |
|
|
const char * |
defaultValue |
|
) |
| |
|
static |
◆ GetNodeParamConfig()
| const char * inet::eigrp::EigrpDeviceConfigurator::GetNodeParamConfig |
( |
cXMLElement * |
node, |
|
|
const char * |
paramName, |
|
|
const char * |
defaultValue |
|
) |
| |
|
static |
780 ASSERT(node !=
nullptr);
782 cXMLElement *paramElem = node->getElementByPath(paramName);
783 if (paramElem ==
nullptr)
786 const char *paramValue = paramElem->getNodeValue();
787 if (paramValue ==
nullptr)
Referenced by loadEigrpIPv4Networks().
◆ isEigrpInterface()
< Gets interfaces that correspond to the IP address and mask
Converts wildcard to netmask and check validity
164 Ipv4Address ifAddress = interface->getProtocolData<Ipv4InterfaceData>()->getIPAddress();
165 Ipv4Address ifmask = interface->getProtocolData<Ipv4InterfaceData>()->getNetmask();
166 vector<int> resultIfs;
167 int maskLength, ifMaskLength;
168 std::vector<EigrpNetwork<Ipv4Address> *>::iterator it;
170 if (ifAddress.isUnspecified())
173 for (it = networks.begin(); it != networks.end(); it++) {
175 prefix = (*it)->getAddress();
176 mask = (*it)->getMask();
178 maskLength = (mask.isUnspecified()) ? prefix.getNetworkMask().getNetmaskLength() : mask.getNetmaskLength();
179 ifMaskLength = ifmask.getNetmaskLength();
184 if (prefix.isUnspecified() ||
185 (mask.isUnspecified() && prefix.isNetwork(ifAddress) && maskLength <= ifMaskLength) ||
186 (prefix.maskedAddrAreEqual(prefix, ifAddress, mask) && maskLength <= ifMaskLength))
Referenced by loadEigrpIPv4Networks().
◆ loadEigrpInterface()
| void inet::eigrp::EigrpDeviceConfigurator::loadEigrpInterface |
( |
cXMLElement * |
eigrpIface, |
|
|
IEigrpModule< Ipv4Address > * |
eigrpModule, |
|
|
int |
ifaceId, |
|
|
const char * |
ifaceName |
|
) |
| |
|
protected |
Loads networks added to EIGRP.
464 bool tempBool, success;
466 cXMLElementList ifDetails = eigrpIface->getChildren();
467 for (cXMLElementList::iterator ifElemIt = ifDetails.begin(); ifElemIt != ifDetails.end(); ifElemIt++) {
468 std::string nodeName = (*ifElemIt)->getTagName();
470 if (nodeName ==
"HelloInterval") {
471 success =
Str2Int(&tempNumber, (*ifElemIt)->getNodeValue());
472 if (!success || tempNumber < 1 || tempNumber > 65535)
473 throw cRuntimeError(
"Bad value for EIGRP Hello interval (<1, 65535>) on interface %s", ifaceName);
476 else if (nodeName ==
"HoldInterval") {
477 success =
Str2Int(&tempNumber, (*ifElemIt)->getNodeValue());
478 if (!success || tempNumber < 1 || tempNumber > 65535)
479 throw cRuntimeError(
"Bad value for EIGRP Hold interval (<1, 65535>) on interface %s", ifaceName);
482 else if (nodeName ==
"SplitHorizon") {
483 if (!
Str2Bool(&tempBool, (*ifElemIt)->getNodeValue()))
484 throw cRuntimeError(
"Bad value for EIGRP Split Horizon on interface %s", ifaceName);
Referenced by loadEigrpInterfacesConfig().
◆ loadEigrpInterface6()
| void inet::eigrp::EigrpDeviceConfigurator::loadEigrpInterface6 |
( |
cXMLElement * |
eigrpIface, |
|
|
IEigrpModule< Ipv6Address > * |
eigrpModule, |
|
|
int |
ifaceId, |
|
|
const char * |
ifaceName |
|
) |
| |
|
protected |
724 bool tempBool, success;
726 cXMLElementList ifDetails = eigrpIface->getChildren();
727 for (cXMLElementList::iterator ifElemIt = ifDetails.begin(); ifElemIt != ifDetails.end(); ifElemIt++) {
728 std::string nodeName = (*ifElemIt)->getTagName();
730 if (nodeName ==
"HelloInterval") {
731 success =
Str2Int(&tempNumber, (*ifElemIt)->getNodeValue());
732 if (!success || tempNumber < 1 || tempNumber > 65535)
733 throw cRuntimeError(
"Bad value for EIGRP Hello interval (<1, 65535>) on interface %s", ifaceName);
736 else if (nodeName ==
"HoldInterval") {
737 success =
Str2Int(&tempNumber, (*ifElemIt)->getNodeValue());
738 if (!success || tempNumber < 1 || tempNumber > 65535)
739 throw cRuntimeError(
"Bad value for EIGRP Hold interval (<1, 65535>) on interface %s", ifaceName);
742 else if (nodeName ==
"SplitHorizon") {
743 if (!
Str2Bool(&tempBool, (*ifElemIt)->getNodeValue()))
744 throw cRuntimeError(
"Bad value for EIGRP Split Horizon on interface %s", ifaceName);
Referenced by loadEigrpInterfaces6Config().
◆ loadEigrpInterfaceParams()
| bool inet::eigrp::EigrpDeviceConfigurator::loadEigrpInterfaceParams |
( |
cXMLElement * |
eigrpIface, |
|
|
IEigrpModule< Ipv4Address > * |
eigrpModule, |
|
|
int |
ifaceId, |
|
|
const char * |
ifaceName |
|
) |
| |
|
protected |
423 bool success, changed =
false;
425 cXMLElementList ifDetails = eigrpIface->getChildren();
426 for (cXMLElementList::iterator ifElemIt = ifDetails.begin(); ifElemIt != ifDetails.end(); ifElemIt++) {
427 std::string nodeName = (*ifElemIt)->getTagName();
429 if (nodeName ==
"Delay") {
430 success =
Str2Int(&tempNumber, (*ifElemIt)->getNodeValue());
431 if (!success || tempNumber < 0 || tempNumber > 16777215)
432 throw cRuntimeError(
"Bad value for EIGRP Delay on interface %s", ifaceName);
433 eigrpModule->
setDelay(tempNumber, ifaceId);
436 else if (nodeName ==
"Bandwidth") {
437 success =
Str2Int(&tempNumber, (*ifElemIt)->getNodeValue());
438 if (!success || tempNumber < 0 || tempNumber > 10000000)
439 throw cRuntimeError(
"Bad value for EIGRP Bandwidth on interface %s", ifaceName);
443 else if (nodeName ==
"Reliability") {
444 success =
Str2Int(&tempNumber, (*ifElemIt)->getNodeValue());
445 if (!success || tempNumber < 1 || tempNumber > 255)
446 throw cRuntimeError(
"Bad value for EIGRP Reliability on interface %s", ifaceName);
450 else if (nodeName ==
"Load") {
451 success =
Str2Int(&tempNumber, (*ifElemIt)->getNodeValue());
452 if (!success || tempNumber < 1 || tempNumber > 255)
453 throw cRuntimeError(
"Bad value for EIGRP Load on interface %s", ifaceName);
454 eigrpModule->
setLoad(tempNumber, ifaceId);
Referenced by loadEigrpInterfacesConfig().
◆ loadEigrpInterfaceParams6()
| bool inet::eigrp::EigrpDeviceConfigurator::loadEigrpInterfaceParams6 |
( |
cXMLElement * |
eigrpIface, |
|
|
IEigrpModule< Ipv6Address > * |
eigrpModule, |
|
|
int |
ifaceId, |
|
|
const char * |
ifaceName |
|
) |
| |
|
protected |
Loads interfaces for EIGRP IPv6.
683 bool success, changed =
false;
685 cXMLElementList ifDetails = eigrpIface->getChildren();
686 for (cXMLElementList::iterator ifElemIt = ifDetails.begin(); ifElemIt != ifDetails.end(); ifElemIt++) {
687 std::string nodeName = (*ifElemIt)->getTagName();
689 if (nodeName ==
"Delay") {
690 success =
Str2Int(&tempNumber, (*ifElemIt)->getNodeValue());
691 if (!success || tempNumber < 0 || tempNumber > 16777215)
692 throw cRuntimeError(
"Bad value for EIGRP Delay on interface %s", ifaceName);
693 eigrpModule->
setDelay(tempNumber, ifaceId);
696 else if (nodeName ==
"Bandwidth") {
697 success =
Str2Int(&tempNumber, (*ifElemIt)->getNodeValue());
698 if (!success || tempNumber < 0 || tempNumber > 10000000)
699 throw cRuntimeError(
"Bad value for EIGRP Bandwidth on interface %s", ifaceName);
703 else if (nodeName ==
"Reliability") {
704 success =
Str2Int(&tempNumber, (*ifElemIt)->getNodeValue());
705 if (!success || tempNumber < 1 || tempNumber > 255)
706 throw cRuntimeError(
"Bad value for EIGRP Reliability on interface %s", ifaceName);
710 else if (nodeName ==
"Load") {
711 success =
Str2Int(&tempNumber, (*ifElemIt)->getNodeValue());
712 if (!success || tempNumber < 1 || tempNumber > 255)
713 throw cRuntimeError(
"Bad value for EIGRP Load on interface %s", ifaceName);
714 eigrpModule->
setLoad(tempNumber, ifaceId);
Referenced by loadEigrpInterfaces6Config().
◆ loadEigrpInterfaces6Config()
| void inet::eigrp::EigrpDeviceConfigurator::loadEigrpInterfaces6Config |
( |
cXMLElement * |
device, |
|
|
IEigrpModule< Ipv6Address > * |
eigrpModule |
|
) |
| |
|
protected |
Loads parameters of interfaces for EIGRP.
598 cXMLElement *eigrpIfaceElem =
nullptr;
599 cXMLElement *ifaceElem =
nullptr;
600 cXMLElement *ipv6AddrElem =
nullptr;
608 while (ifaceElem !=
nullptr) {
610 const char *ifaceName = ifaceElem->getAttribute(
"name");
612 if (iface ==
nullptr) {
613 throw cRuntimeError(
"No interface called %s on this device", ifaceName);
616 auto int6data = iface->findProtocolDataForUpdate<Ipv6InterfaceData>();
620 while (ipv6AddrElem !=
nullptr) {
623 string addrFull = ipv6AddrElem->getNodeValue();
628 if (!ipv6.tryParseAddrWithPrefix(addrFull.c_str(), prefixLen)) {
629 throw cRuntimeError(
"Unable to set IPv6 address %s on interface %s", addrFull.c_str(), ifaceName);
632 ipv6 = Ipv6Address(addrFull.substr(0, addrFull.find_last_of(
'/')).c_str());
634 int6data->assignAddress(ipv6,
false, SIMTIME_ZERO, SIMTIME_ZERO);
639 if (!eigrpModule->
addNetPrefix(ipv6.getPrefix(prefixLen), prefixLen, iface->getInterfaceId())) {
642 EV_DEBUG <<
"ERROR: Same IPv6 network prefix (" << ipv6.getPrefix(prefixLen) <<
"/" << prefixLen <<
") on different interfaces (prefix ignored on " << ifaceName <<
")" << endl;
649 int ifaceId = iface->getInterfaceId();
652 eigrpIfaceElem = ifaceElem->getFirstChildWithTag(
"EIGRP-IPv6");
655 if (eigrpIfaceElem !=
nullptr) {
657 const char *asNumStr;
658 if ((asNumStr = eigrpIfaceElem->getAttribute(
"asNumber")) ==
nullptr)
659 throw cRuntimeError(
"No EIGRP autonomous system number specified in settings of interface %s", ifaceName);
660 success =
Str2Int(&tempNumber, asNumStr);
661 if (!success || tempNumber < 1 || tempNumber > 65535)
662 throw cRuntimeError(
"Bad value for EIGRP autonomous system number (<1, 65535>) on interface %s", ifaceName);
665 if (tempNumber == eigrpModule->
getASNum()) {
671 eigrpModule->
addInterface(iface->getInterfaceId(),
true);
Referenced by loadEigrpIPv6Config().
◆ loadEigrpInterfacesConfig()
| void inet::eigrp::EigrpDeviceConfigurator::loadEigrpInterfacesConfig |
( |
cXMLElement * |
device, |
|
|
IEigrpModule< Ipv4Address > * |
eigrpModule |
|
) |
| |
|
protected |
Loads parameters of interfaces for EIGRP.
379 cXMLElement *eigrpIfaceElem =
nullptr;
380 cXMLElement *ifaceElem =
nullptr;
387 while (ifaceElem !=
nullptr) {
389 const char *ifaceName = ifaceElem->getAttribute(
"name");
391 if (iface ==
nullptr) {
392 throw cRuntimeError(
"No interface called %s on this device", ifaceName);
394 int ifaceId = iface->getInterfaceId();
397 eigrpIfaceElem = ifaceElem->getFirstChildWithTag(
"EIGRP-IPv4");
400 if (eigrpIfaceElem !=
nullptr) {
402 const char *asNumStr;
403 if ((asNumStr = eigrpIfaceElem->getAttribute(
"asNumber")) ==
nullptr)
404 throw cRuntimeError(
"No EIGRP autonomous system number specified in settings of interface %s", ifaceName);
405 success =
Str2Int(&tempNumber, asNumStr);
406 if (!success || tempNumber < 1 || tempNumber > 65535)
407 throw cRuntimeError(
"Bad value for EIGRP autonomous system number (<1, 65535>) on interface %s", ifaceName);
409 if (tempNumber == eigrpModule->
getASNum()) {
Referenced by loadEigrpIPv4Config().
◆ loadEigrpIPv4Config()
Loads configuration for EIGRP.
- Parameters
-
251 ASSERT(eigrpModule !=
nullptr);
260 EV_DEBUG <<
"No EIGRP configuration found for this device!" << endl;
Referenced by inet::eigrp::EigrpIpv4Pdm::initialize().
◆ loadEigrpIPv4Networks()
| void inet::eigrp::EigrpDeviceConfigurator::loadEigrpIPv4Networks |
( |
cXMLElement * |
processElem, |
|
|
IEigrpModule< Ipv4Address > * |
eigrpModule |
|
) |
| |
|
protected |
Loads K-value and converts it to number.
197 const char *addressStr, *wildcardStr;
198 Ipv4Address address, mask;
199 std::vector<EigrpNetwork<Ipv4Address> *> networks;
200 EigrpNetwork<Ipv4Address> *net;
201 NetworkInterface *iface;
203 cXMLElement *netoworkParentElem = processElem->getFirstChildWithTag(
"Networks");
204 if (netoworkParentElem ==
nullptr)
208 while (networkElem !=
nullptr) {
210 if ((addressStr =
GetNodeParamConfig(networkElem,
"IPAddress",
nullptr)) ==
nullptr) {
211 throw cRuntimeError(
"No IP address specified in the IPAddress node");
218 address.set(addressStr);
219 if (wildcardStr ==
nullptr) {
226 mask = Ipv4Address(wildcardStr);
227 if (mask.isUnspecified() || !mask.isValidNetmask()) {
229 throw cRuntimeError(
"Invalid wildcard in EIGRP network configuration");
231 address = address.doAnd(mask);
235 networks.push_back(net);
245 eigrpModule->
addInterface(iface->getInterfaceId(), net->getNetworkId(),
true);
Referenced by loadEigrpProcessesConfig().
◆ loadEigrpIPv6Config()
Loads configuration for EIGRP IPv6.
- Parameters
-
492 ASSERT(eigrpModule !=
nullptr);
502 EV_DEBUG <<
"No EIGRP configuration found for this device!" << endl;
Referenced by inet::eigrp::EigrpIpv6Pdm::initialize().
◆ loadEigrpKValue()
| int inet::eigrp::EigrpDeviceConfigurator::loadEigrpKValue |
( |
cXMLElement * |
node, |
|
|
const char * |
attrName, |
|
|
const char * |
attrValue |
|
) |
| |
|
protected |
◆ loadEigrpProcesses6Config()
| void inet::eigrp::EigrpDeviceConfigurator::loadEigrpProcesses6Config |
( |
cXMLElement * |
device, |
|
|
IEigrpModule< Ipv6Address > * |
eigrpModule |
|
) |
| |
|
protected |
Loads configuration of interfaces for EIGRP IPv6.
514 cXMLElement *processElem =
nullptr;
515 cXMLElementList procDetails;
518 const char *asNumStr;
524 if (processElem ==
nullptr) {
525 EV_DEBUG <<
"No EIGRP configuration found." << endl;
530 if ((asNumStr = processElem->getAttribute(
"asNumber")) ==
nullptr)
531 throw cRuntimeError(
"No EIGRP autonomous system number specified");
532 success =
Str2Int(&asNum, asNumStr);
533 if (!success || asNum < 1 || asNum > 65535)
534 throw cRuntimeError(
"Bad value for EIGRP autonomous system number (<1, 65535>)");
538 if ((rIdStr = processElem->getAttribute(
"routerId")) ==
nullptr)
539 throw cRuntimeError(
"No EIGRP routerID specified");
542 procDetails = processElem->getChildren();
543 for (cXMLElementList::iterator procElem = procDetails.begin(); procElem != procDetails.end(); procElem++) {
544 std::string nodeName = (*procElem)->getTagName();
546 if (nodeName ==
"MetricWeights") {
556 else if (nodeName ==
"MaximumPath") {
557 success =
Str2Int(&tempNumber, (*procElem)->getNodeValue());
558 if (!success || tempNumber < 1)
559 throw cRuntimeError(
"Bad value for EIGRP maximum paths for load balancing <1, 255>");
562 else if (nodeName ==
"Variance") {
563 success =
Str2Int(&tempNumber, (*procElem)->getNodeValue());
564 if (!success || tempNumber < 1 || tempNumber > 128)
565 throw cRuntimeError(
"Bad value for EIGRP variance (<1, 128>)");
568 else if (nodeName ==
"PassiveInterface") {
570 const char *ifaceName = (*procElem)->getNodeValue();
572 if (iface ==
nullptr) {
573 throw cRuntimeError(
"No interface called %s on this device", ifaceName);
575 int ifaceId = iface->getInterfaceId();
578 else if (nodeName ==
"Stub") {
586 if (!(stub.connectedRt || stub.leakMapRt || stub.recvOnlyRt || stub.redistributedRt || stub.staticRt || stub.summaryRt))
587 stub.connectedRt = stub.summaryRt =
true;
Referenced by loadEigrpIPv6Config().
◆ loadEigrpProcessesConfig()
| void inet::eigrp::EigrpDeviceConfigurator::loadEigrpProcessesConfig |
( |
cXMLElement * |
device, |
|
|
IEigrpModule< Ipv4Address > * |
eigrpModule |
|
) |
| |
|
protected |
Loads configuration of interfaces for EIGRP.
272 cXMLElement *processElem =
nullptr;
273 cXMLElementList procDetails;
276 const char *asNumStr;
281 if (processElem ==
nullptr) {
282 EV_DEBUG <<
"No EIGRP configuration found." << endl;
286 while (processElem !=
nullptr) {
288 if ((asNumStr = processElem->getAttribute(
"asNumber")) ==
nullptr)
289 throw cRuntimeError(
"No EIGRP autonomous system number specified");
290 success =
Str2Int(&asNum, asNumStr);
291 if (!success || asNum < 1 || asNum > 65535)
292 throw cRuntimeError(
"Bad value for EIGRP autonomous system number (<1, 65535>)");
297 procDetails = processElem->getChildren();
298 for (cXMLElementList::iterator procElem = procDetails.begin(); procElem != procDetails.end(); procElem++) {
299 std::string nodeName = (*procElem)->getTagName();
300 if (nodeName ==
"MetricWeights") {
310 else if (nodeName ==
"MaximumPath") {
311 success =
Str2Int(&tempNumber, (*procElem)->getNodeValue());
312 if (!success || tempNumber < 1)
313 throw cRuntimeError(
"Bad value for EIGRP maximum paths for load balancing <1, 255>");
316 else if (nodeName ==
"Variance") {
317 success =
Str2Int(&tempNumber, (*procElem)->getNodeValue());
318 if (!success || tempNumber < 1 || tempNumber > 128)
319 throw cRuntimeError(
"Bad value for EIGRP variance (<1, 128>)");
322 else if (nodeName ==
"PassiveInterface") {
324 const char *ifaceName = (*procElem)->getNodeValue();
326 if (iface ==
nullptr) {
327 throw cRuntimeError(
"No interface called %s on this device", ifaceName);
329 int ifaceId = iface->getInterfaceId();
332 else if (nodeName ==
"Stub") {
340 if (!(stub.connectedRt || stub.leakMapRt || stub.recvOnlyRt || stub.redistributedRt || stub.staticRt || stub.summaryRt))
341 stub.connectedRt = stub.summaryRt =
true;
Referenced by loadEigrpIPv4Config().
◆ loadEigrpStubConf()
| bool inet::eigrp::EigrpDeviceConfigurator::loadEigrpStubConf |
( |
cXMLElement * |
node, |
|
|
const char * |
attrName |
|
) |
| |
|
protected |
◆ Str2Bool()
| bool inet::eigrp::EigrpDeviceConfigurator::Str2Bool |
( |
bool * |
ret, |
|
|
const char * |
str |
|
) |
| |
|
static |
109 if ((strcmp(str,
"yes") == 0)
110 || (strcmp(str,
"enabled") == 0)
111 || (strcmp(str,
"on") == 0)
112 || (strcmp(str,
"true") == 0))
119 if ((strcmp(str,
"no") == 0)
120 || (strcmp(str,
"disabled") == 0)
121 || (strcmp(str,
"off") == 0)
122 || (strcmp(str,
"false") == 0))
Referenced by loadEigrpInterface(), loadEigrpInterface6(), and loadEigrpStubConf().
◆ Str2Int()
| bool inet::eigrp::EigrpDeviceConfigurator::Str2Int |
( |
int * |
retValue, |
|
|
const char * |
str |
|
) |
| |
|
static |
89 if (retValue ==
nullptr || str ==
nullptr) {
97 value = strtol(str, &
tail, 0);
99 if (*
tail !=
'\0' || errno == ERANGE || errno == EINVAL || value < INT_MIN || value > INT_MAX) {
103 *retValue = (int)value;
Referenced by loadEigrpInterface(), loadEigrpInterface6(), loadEigrpInterfaceParams(), loadEigrpInterfaceParams6(), loadEigrpInterfaces6Config(), loadEigrpInterfacesConfig(), loadEigrpKValue(), loadEigrpProcesses6Config(), loadEigrpProcessesConfig(), and Str2Bool().
◆ wildcardToMask()
| bool inet::eigrp::EigrpDeviceConfigurator::wildcardToMask |
( |
const char * |
wildcard, |
|
|
Ipv4Address & |
result |
|
) |
| |
|
protected |
Loads configuration of EIGRP process.
147 result.set(wildcard);
148 uint32_t wcNum = result.getInt();
154 if (!result.isValidNetmask())
Referenced by loadEigrpIPv4Networks().
◆ configFile
| cXMLElement* inet::eigrp::EigrpDeviceConfigurator::configFile = nullptr |
|
private |
◆ device
| cXMLElement* inet::eigrp::EigrpDeviceConfigurator::device = nullptr |
|
private |
◆ ift
The documentation for this class was generated from the following files:
static cXMLElement * GetEigrpProcess(cXMLElement *process, cXMLElement *device)
Definition: EigrpDeviceConfigurator.cc:804
virtual void setPassive(bool passive, int ifaceId)=0
virtual void setDelay(int delay, int interfaceId)=0
cXMLElement * device
Definition: EigrpDeviceConfigurator.h:33
@ LINK
Definition: Ipv6Address.h:46
Ipv4Address getNetwork() const
Returns an address with the network part of the address (the bits of the hosts part are to 0).
Definition: Ipv4Address.cc:157
virtual void setReliability(int reability, int interfaceId)=0
static cXMLElement * GetIPv6Address(cXMLElement *addr, cXMLElement *iface)
Definition: EigrpDeviceConfigurator.cc:66
virtual EigrpNetwork< IPAddress > * addNetwork(IPAddress address, IPAddress mask)=0
Adds new network to EigrpNetworkTable for routing.
virtual void setMaximumPath(int maximumPath)=0
void loadEigrpInterface6(cXMLElement *eigrpIface, IEigrpModule< Ipv6Address > *eigrpModule, int ifaceId, const char *ifaceName)
Definition: EigrpDeviceConfigurator.cc:721
virtual void setLoad(int load, int interfaceId)=0
virtual bool addNetPrefix(const IPAddress &network, const short int prefixLen, const int ifaceId)=0
Adds information about IPv6 network prefix.
void loadEigrpProcessesConfig(cXMLElement *device, IEigrpModule< Ipv4Address > *eigrpModule)
Loads configuration of interfaces for EIGRP.
Definition: EigrpDeviceConfigurator.cc:269
EigrpNetwork< Ipv4Address > * isEigrpInterface(std::vector< EigrpNetwork< Ipv4Address > * > &networks, NetworkInterface *interface)
< Gets interfaces that correspond to the IP address and mask
Definition: EigrpDeviceConfigurator.cc:160
virtual void addInterface(int interfaceId, int networkId, bool enabled)=0
Adds interface to EIGRP.
bool wildcardToMask(const char *wildcard, Ipv4Address &result)
Loads configuration of EIGRP process.
Definition: EigrpDeviceConfigurator.cc:145
IInterfaceTable * ift
Definition: EigrpDeviceConfigurator.h:36
static const char * GetNodeAttrConfig(cXMLElement *node, const char *attrName, const char *defaultValue)
Definition: EigrpDeviceConfigurator.cc:793
virtual void setKValues(const EigrpKValues &kValues)=0
virtual void setHoldInt(int interval, int interfaceId)=0
void loadEigrpIPv4Networks(cXMLElement *processElem, IEigrpModule< Ipv4Address > *eigrpModule)
Loads K-value and converts it to number.
Definition: EigrpDeviceConfigurator.cc:195
virtual NetworkInterface * findInterfaceByName(const char *name) const =0
Returns an interface given by its name.
static const char * GetNodeParamConfig(cXMLElement *node, const char *paramName, const char *defaultValue)
Definition: EigrpDeviceConfigurator.cc:778
virtual void setSplitHorizon(bool shEnabled, int interfaceId)=0
int loadEigrpKValue(cXMLElement *node, const char *attrName, const char *attrValue)
Loads stub configuration.
Definition: EigrpDeviceConfigurator.cc:350
static bool Str2Bool(bool *ret, const char *str)
Definition: EigrpDeviceConfigurator.cc:107
static bool Str2Int(int *retValue, const char *str)
Definition: EigrpDeviceConfigurator.cc:87
static cXMLElement * GetEigrpProcess6(cXMLElement *process, cXMLElement *device)
Definition: EigrpDeviceConfigurator.cc:750
void loadEigrpInterfacesConfig(cXMLElement *device, IEigrpModule< Ipv4Address > *eigrpModule)
Loads parameters of interfaces for EIGRP.
Definition: EigrpDeviceConfigurator.cc:376
bool loadEigrpInterfaceParams(cXMLElement *eigrpIface, IEigrpModule< Ipv4Address > *eigrpModule, int ifaceId, const char *ifaceName)
Definition: EigrpDeviceConfigurator.cc:420
bool loadEigrpInterfaceParams6(cXMLElement *eigrpIface, IEigrpModule< Ipv6Address > *eigrpModule, int ifaceId, const char *ifaceName)
Loads interfaces for EIGRP IPv6.
Definition: EigrpDeviceConfigurator.cc:680
virtual void setStub(const EigrpStub &stub)=0
virtual void setBandwidth(int bandwith, int interfaceId)=0
static cXMLElement * GetEigrpIPv4Network(cXMLElement *network, cXMLElement *process)
Definition: EigrpDeviceConfigurator.cc:832
bool loadEigrpStubConf(cXMLElement *node, const char *attrName)
Loads configuration of EIGRP IPv6 process.
Definition: EigrpDeviceConfigurator.cc:362
void loadEigrpInterface(cXMLElement *eigrpIface, IEigrpModule< Ipv4Address > *eigrpModule, int ifaceId, const char *ifaceName)
Loads networks added to EIGRP.
Definition: EigrpDeviceConfigurator.cc:461
virtual int getNumInterfaces() const =0
Returns the number of interfaces.
static const Ipv4Address UNSPECIFIED_ADDRESS
0.0.0.0
Definition: Ipv4Address.h:91
Point< TS ... > tail(const Point< T, TS ... > &p)
Returns all but the first coordinate of p.
Definition: Point.h:228
void loadEigrpProcesses6Config(cXMLElement *device, IEigrpModule< Ipv6Address > *eigrpModule)
Loads configuration of interfaces for EIGRP IPv6.
Definition: EigrpDeviceConfigurator.cc:511
virtual void setVariance(int variance)=0
virtual void setRouterId(Ipv4Address routerID)=0
Sets router ID.
virtual void setHelloInt(int interval, int interfaceId)=0
virtual NetworkInterface * getInterface(int pos) const =0
Returns the NetworkInterface specified by an index 0..numInterfaces-1.
virtual void updateInterface(int interfaceId)=0
cXMLElement * configFile
Definition: EigrpDeviceConfigurator.h:32
void loadEigrpInterfaces6Config(cXMLElement *device, IEigrpModule< Ipv6Address > *eigrpModule)
Loads parameters of interfaces for EIGRP.
Definition: EigrpDeviceConfigurator.cc:595
static cXMLElement * GetInterface(cXMLElement *iface, cXMLElement *device)
Definition: EigrpDeviceConfigurator.cc:43
virtual void setASNum(int asNum)=0