|
INET Framework for OMNeT++/OMNEST
|
#include <Ospfv3Interface.h>
|
| enum | Ospfv3InterfaceFaState {
INTERFACE_STATE_DOWN = 0,
INTERFACE_STATE_LOOPBACK = 1,
INTERFACE_STATE_WAITING = 2,
INTERFACE_STATE_POINTTOPOINT = 3,
INTERFACE_STATE_DROTHER = 4,
INTERFACE_STATE_BACKUP = 5,
INTERFACE_STATE_DESIGNATED = 6,
INTERFACE_PASSIVE = 7
} |
| |
| enum | Ospfv3InterfaceEvent {
INTERFACE_UP_EVENT = 0,
UNLOOP_IND_EVENT = 1,
WAIT_TIMER_EVENT = 2,
BACKUP_SEEN_EVENT = 3,
NEIGHBOR_CHANGE_EVENT = 4,
INTERFACE_DOWN_EVENT = 5,
LOOP_IND_EVENT = 6,
HELLO_TIMER_EVENT = 7,
ACKNOWLEDGEMENT_TIMER_EVENT = 8,
NEIGHBOR_REVIVED_EVENT = 9
} |
| |
| enum | Ospfv3InterfaceType {
UNKNOWN_TYPE = 0,
POINTTOPOINT_TYPE = 1,
BROADCAST_TYPE = 2,
NBMA_TYPE = 3,
POINTTOMULTIPOINT_TYPE = 4,
VIRTUAL_TYPE = 5
} |
| |
|
| | Ospfv3Interface (const char *name, cModule *routerModule, Ospfv3Process *processModule, Ospfv3InterfaceType interfaceType, bool passive) |
| |
| virtual | ~Ospfv3Interface () |
| |
| std::string | getIntName () const |
| |
| void | reset () |
| |
| void | processEvent (Ospfv3Interface::Ospfv3InterfaceEvent) |
| |
| void | setRouterPriority (int newPriority) |
| |
| void | setHelloInterval (int newInterval) |
| |
| void | setDeadInterval (int newInterval) |
| |
| void | setInterfaceCost (int newInterval) |
| |
| void | setInterfaceType (Ospfv3InterfaceType newType) |
| |
| void | setAckDelay (int newAckDelay) |
| |
| void | setDesignatedIP (Ipv6Address newIP) |
| |
| void | setBackupIP (Ipv6Address newIP) |
| |
| void | setDesignatedID (Ipv4Address newID) |
| |
| void | setDesignatedIntID (int newIntID) |
| |
| void | setBackupID (Ipv4Address newID) |
| |
| void | sendDelayedAcknowledgements () |
| |
| void | setInterfaceIndex (int newIndex) |
| |
| void | setTransitAreaID (Ipv4Address areaId) |
| |
| int | getRouterPriority () const |
| |
| short | getHelloInterval () const |
| |
| short | getDeadInterval () const |
| |
| short | getPollInterval () const |
| |
| short | getTransDelayInterval () const |
| |
| short | getRetransmissionInterval () const |
| |
| short | getAckDelay () const |
| |
| int | getInterfaceCost () const |
| |
| int | getInterfaceId () const |
| |
| int | getInterfaceIndex () const |
| |
| int | getNeighborCount () const |
| |
| int | getInterfaceMTU () const |
| |
| int | getInterfaceIndex () |
| |
| Ipv6Address | getInterfaceLLIP () const |
| |
| bool | isInterfacePassive () |
| |
| Ipv4Address | getTransitAreaID () const |
| |
| Ospfv3InterfaceType | getType () const |
| |
| Ospfv3Neighbor * | getNeighbor (int i) |
| |
| Ipv6Address | getDesignatedIP () const |
| |
| Ipv6Address | getBackupIP () const |
| |
| Ipv4Address | getDesignatedID () const |
| |
| Ipv4Address | getBackupID () const |
| |
| int | getDesignatedIntID () const |
| |
| void | removeNeighborByID (Ipv4Address neighborID) |
| |
| int | calculateInterfaceCost () |
| |
| cMessage * | getWaitTimer () |
| |
| cMessage * | getHelloTimer () |
| |
| cMessage * | getAcknowledgementTimer () |
| |
| Ospfv3Area * | getArea () const |
| |
| void | setArea (Ospfv3Area *area) |
| |
| Ospfv3InterfaceState * | getCurrentState () |
| |
| Ospfv3InterfaceState * | getPreviousState () |
| |
| void | changeState (Ospfv3InterfaceState *currentState, Ospfv3InterfaceState *newState) |
| |
| Ospfv3Interface::Ospfv3InterfaceFaState | getState () const |
| |
| void | processHelloPacket (Packet *packet) |
| |
| void | processDDPacket (Packet *packet) |
| |
| bool | preProcessDDPacket (Packet *packet, Ospfv3Neighbor *neighbor, bool inExchangeStart) |
| |
| void | processLSR (Packet *packet, Ospfv3Neighbor *neighbor) |
| |
| void | processLSU (Packet *packet, Ospfv3Neighbor *neighbor) |
| |
| void | processLSAck (Packet *packet, Ospfv3Neighbor *neighbor) |
| |
| bool | floodLSA (const Ospfv3Lsa *lsa, Ospfv3Interface *interface=nullptr, Ospfv3Neighbor *neighbor=nullptr) |
| |
| void | removeFromAllRetransmissionLists (LSAKeyType lsaKey) |
| |
| bool | isOnAnyRetransmissionList (LSAKeyType lsaKey) const |
| |
| bool | hasAnyNeighborInState (int state) const |
| |
| void | ageTransmittedLSALists () |
| |
| Packet * | prepareHello () |
| |
| Packet * | prepareLSUHeader () |
| |
| Packet * | prepareUpdatePacket (std::vector< Ospfv3Lsa * > lsas) |
| |
| Ospfv3Neighbor * | getNeighborById (Ipv4Address neighborId) |
| |
| void | addNeighbor (Ospfv3Neighbor *) |
| |
| std::string | str () const override |
| |
| std::string | detailedInfo () const |
| |
| void | acknowledgeLSA (const Ospfv3LsaHeader &lsaHeader, AcknowledgementFlags ackFlags, Ipv4Address routerID) |
| |
| LinkLSA * | originateLinkLSA () |
| |
| bool | installLinkLSA (const Ospfv3LinkLsa *lsa) |
| |
| void | addLinkLSA (LinkLSA *newLSA) |
| |
| int | getLinkLSACount () |
| |
| LinkLSA * | getLinkLSA (int i) |
| |
| LinkLSA * | getLinkLSAbyKey (LSAKeyType lsaKey) |
| |
| bool | updateLinkLSA (LinkLSA *currentLsa, const Ospfv3LinkLsa *newLsa) |
| |
| bool | linkLSADiffersFrom (Ospfv3LinkLsa *currentLsa, const Ospfv3LinkLsa *newLsa) |
| |
| LinkLSA * | findLinkLSAbyAdvRouter (Ipv4Address advRouter) |
| |
| void | sendLSAcknowledgement (const Ospfv3LsaHeader *lsaHeader, Ipv6Address destination) |
| |
| void | addDelayedAcknowledgement (const Ospfv3LsaHeader &lsaHeader) |
| |
| void | setTransitNetInt (bool isTransit) |
| |
| bool | getTransitNetInt () |
| |
| void | addInterfaceAddress (Ipv6AddressRange address) |
| |
| int | getInterfaceAddressCount () |
| |
| Ipv6AddressRange | getInterfaceAddress (int i) |
| |
| bool | ageDatabase () |
| |
◆ Ospfv3InterfaceEvent
| Enumerator |
|---|
| INTERFACE_UP_EVENT | |
| UNLOOP_IND_EVENT | |
| WAIT_TIMER_EVENT | |
| BACKUP_SEEN_EVENT | |
| NEIGHBOR_CHANGE_EVENT | |
| INTERFACE_DOWN_EVENT | |
| LOOP_IND_EVENT | |
| HELLO_TIMER_EVENT | |
| ACKNOWLEDGEMENT_TIMER_EVENT | |
| NEIGHBOR_REVIVED_EVENT | |
◆ Ospfv3InterfaceFaState
| Enumerator |
|---|
| INTERFACE_STATE_DOWN | |
| INTERFACE_STATE_LOOPBACK | |
| INTERFACE_STATE_WAITING | |
| INTERFACE_STATE_POINTTOPOINT | |
| INTERFACE_STATE_DROTHER | |
| INTERFACE_STATE_BACKUP | |
| INTERFACE_STATE_DESIGNATED | |
| INTERFACE_PASSIVE | |
◆ Ospfv3InterfaceType
| Enumerator |
|---|
| UNKNOWN_TYPE | |
| POINTTOPOINT_TYPE | |
| BROADCAST_TYPE | |
| NBMA_TYPE | |
| POINTTOMULTIPOINT_TYPE | |
| VIRTUAL_TYPE | |
◆ Ospfv3Interface()
| inet::ospfv3::Ospfv3Interface::Ospfv3Interface |
( |
const char * |
name, |
|
|
cModule * |
routerModule, |
|
|
Ospfv3Process * |
processModule, |
|
|
Ospfv3InterfaceType |
interfaceType, |
|
|
bool |
passive |
|
) |
| |
29 this->
state =
new Ospfv3InterfaceStateDown;
32 this->
ift = check_and_cast<IInterfaceTable *>(
containingModule->getSubmodule(
"interfaceTable"));
35 const auto& ipv6int = ie->getProtocolData<Ipv6InterfaceData>();
◆ ~Ospfv3Interface()
| inet::ospfv3::Ospfv3Interface::~Ospfv3Interface |
( |
| ) |
|
|
virtual |
65 for (
long i = 0; i < neighborCount; i++) {
69 for (
long j = 0; j < lsaCount; j++) {
◆ acknowledgeLSA()
1325 EV_DEBUG <<
"AcknowledgeLSA\n";
1326 bool sendDirectAcknowledgment =
false;
1328 if (!acknowledgementFlags.floodedBackOut) {
1329 EV_DEBUG <<
"\tFloodedBackOut is false\n";
1331 if ((acknowledgementFlags.lsaIsNewer && (lsaSource == this->getDesignatedID())) ||
1332 (acknowledgementFlags.lsaIsDuplicate && acknowledgementFlags.impliedAcknowledgement))
1334 EV_DEBUG <<
"Adding delayed acknowledgement\n";
1338 if ((acknowledgementFlags.lsaIsDuplicate && !acknowledgementFlags.impliedAcknowledgement) ||
1339 (acknowledgementFlags.lsaReachedMaxAge &&
1340 acknowledgementFlags.noLSAInstanceInDatabase &&
1341 acknowledgementFlags.anyNeighborInExchangeOrLoadingState))
1343 sendDirectAcknowledgment =
true;
1348 if (acknowledgementFlags.lsaIsNewer) {
1349 EV_DEBUG <<
"Adding delayed acknowledgement\n";
1353 if ((acknowledgementFlags.lsaIsDuplicate && !acknowledgementFlags.impliedAcknowledgement) ||
1354 (acknowledgementFlags.lsaReachedMaxAge &&
1355 acknowledgementFlags.noLSAInstanceInDatabase &&
1356 acknowledgementFlags.anyNeighborInExchangeOrLoadingState))
1358 sendDirectAcknowledgment =
true;
1364 if (sendDirectAcknowledgment) {
1365 const auto& ackPacket = makeShared<Ospfv3LinkStateAcknowledgementPacket>();
1368 ackPacket->setRouterID(this->
getArea()->getInstance()->getProcess()->getRouterID());
1369 ackPacket->setAreaID(this->
getArea()->getAreaID());
1370 ackPacket->setInstanceID(this->
getArea()->getInstance()->getInstanceID());
1372 ackPacket->setLsaHeadersArraySize(1);
1373 ackPacket->setLsaHeaders(0, lsaHeader);
1378 Packet *pk =
new Packet();
1379 pk->insertAtBack(ackPacket);
Referenced by processLSU().
◆ addDelayedAcknowledgement()
| void inet::ospfv3::Ospfv3Interface::addDelayedAcknowledgement |
( |
const Ospfv3LsaHeader & |
lsaHeader | ) |
|
1431 EV_DEBUG <<
"calling add delayded ack\n";
1444 long neighborCount = this->
neighbors.size();
1445 for (
long i = 0; i < neighborCount; i++) {
Referenced by acknowledgeLSA().
◆ addInterfaceAddress()
| void inet::ospfv3::Ospfv3Interface::addInterfaceAddress |
( |
Ipv6AddressRange |
address | ) |
|
|
inline |
◆ addLinkLSA()
| void inet::ospfv3::Ospfv3Interface::addLinkLSA |
( |
LinkLSA * |
newLSA | ) |
|
|
inline |
◆ addNeighbor()
| void inet::ospfv3::Ospfv3Interface::addNeighbor |
( |
Ospfv3Neighbor * |
newNeighbor | ) |
|
1719 EV_DEBUG <<
"^^^^^^^^ FROM addNeighbor ^^^^^^^^^^\n";
1720 EV_DEBUG << newNeighbor->getNeighborID() <<
" / " << newNeighbor->getNeighborInterfaceID() <<
" / " << newNeighbor->getInterface()->getInterfaceId() <<
"\n";
1721 Ospfv3Neighbor *check = this->
getNeighborById(newNeighbor->getNeighborID());
1722 if (check ==
nullptr) {
1724 this->
neighborsById[newNeighbor->getNeighborID()] = newNeighbor;
Referenced by processHelloPacket().
◆ ageDatabase()
| bool inet::ospfv3::Ospfv3Interface::ageDatabase |
( |
| ) |
|
131 bool shouldRebuildRoutingTable =
false;
134 for (i = 0; i < lsaCount; i++) {
136 unsigned short lsAge = lsa->getHeader().getLsaAge();
141 if ((selfOriginated && (lsAge < (
LS_REFRESH_TIME - 1))) || (!selfOriginated && (lsAge < (
MAX_AGE - 1)))) {
142 lsa->getHeaderForUpdate().setLsaAge(lsAge + 1);
144 if (!lsa->validateLSChecksum()) {
145 EV_ERROR <<
"Invalid LS checksum. Memory error detected!\n";
148 lsa->incrementInstallTime();
158 long sequenceNumber = lsa->getHeader().getLsaSequenceNumber();
160 lsa->getHeaderForUpdate().setLsaAge(
MAX_AGE);
162 lsa->incrementInstallTime();
166 newLSA->getHeaderForUpdate().setLsaSequenceNumber(sequenceNumber + 1);
173 if (!selfOriginated && (lsAge ==
MAX_AGE - 1)) {
174 lsa->getHeaderForUpdate().setLsaAge(
MAX_AGE);
176 lsa->incrementInstallTime();
181 lsaKey.linkStateID = lsa->getHeader().getLinkStateID();
182 lsaKey.advertisingRouter = lsa->getHeader().getAdvertisingRouter();
189 if (!selfOriginated ) {
193 shouldRebuildRoutingTable =
true;
197 long sequenceNumber = lsa->getHeader().getLsaSequenceNumber();
199 if (newLSA !=
nullptr) {
215 if ((*linkIt) ==
nullptr) {
222 return shouldRebuildRoutingTable;
◆ ageTransmittedLSALists()
| void inet::ospfv3::Ospfv3Interface::ageTransmittedLSALists |
( |
| ) |
|
123 for (
long i = 0; i < neighborCount; i++) {
◆ calculateInterfaceCost()
| int inet::ospfv3::Ospfv3Interface::calculateInterfaceCost |
( |
| ) |
|
◆ changeState()
89 EV_DEBUG <<
"Interface state is changing from " << currentState->getInterfaceStateString() <<
" to " << newState->getInterfaceStateString() <<
"\n";
95 this->
state = newState;
96 EV_DEBUG <<
"Changing state of interface \n";
Referenced by inet::ospfv3::Ospfv3InterfaceState::changeState().
◆ detailedInfo()
| std::string inet::ospfv3::Ospfv3Interface::detailedInfo |
( |
| ) |
const |
1919 std::stringstream out;
1920 Ipv4Address neighbor;
1921 Ipv6Address designatedIP;
1922 Ipv6Address backupIP;
1925 for (
auto it = this->
neighbors.begin(); it != this->neighbors.end(); it++) {
1929 if ((*it)->getNeighborID() == this->DesignatedRouterID)
1930 designatedIP = (*it)->getNeighborIP();
1931 if ((*it)->getNeighborID() == this->BackupRouterID)
1932 backupIP = (*it)->getNeighborIP();
1935 out <<
"Interface " << this->
getIntName() <<
"\n";
1936 out <<
"Link Local Address ";
1938 const auto& ipv6int = ie->getProtocolData<Ipv6InterfaceData>();
1939 out << ipv6int->getLinkLocalAddress() <<
", Interface ID " << this->
interfaceId <<
"\n";
1942 const auto& ipv4int = ie->getProtocolData<Ipv4InterfaceData>();
1943 out <<
"Internet Address " << ipv4int->getIPAddress() << endl;
1961 out <<
"Backup Designated router (ID) " << this->
getBackupID().
str(
false);
1962 out <<
", local address " << this->
getBackupIP() << endl;
1969 out <<
"\tHello due in " << (int)simTime().dbl() % this->
helloInterval << endl;
1972 out <<
", Adjacent neighbor count is " << adjCount << endl;
1974 for (
auto it = this->
neighbors.begin(); it != this->neighbors.end(); it++) {
1975 if ((*it)->getNeighborID() == this->DesignatedRouterID)
1976 out <<
"Adjacent with neighbor " << this->
DesignatedRouterID <<
"(Designated Router)\n";
1977 else if ((*it)->getNeighborID() == this->BackupRouterID)
1978 out <<
"Adjacent with neighbor " << this->
BackupRouterID <<
"(Backup Designated Router)\n";
1980 out <<
"Adjacent with neighbor " << (*it)->getNeighborID() << endl;
1983 out <<
"Suppress Hello for 0 neighbor(s)\n";
Referenced by inet::ospfv3::operator<<().
◆ findLinkLSAbyAdvRouter()
1901 for (
auto it = this->
linkLSAList.begin(); it != this->linkLSAList.end(); it++) {
1902 if ((*it)->getHeader().getAdvertisingRouter() == advRouter)
◆ floodLSA()
1523 bool floodedBackOut =
false;
1529 (this->getArea()->getExternalRoutingCapability())
1546 bool lsaAddedToRetransmissionList =
false;
1547 Ipv4Address linkStateID = lsa->getHeader().getLinkStateID();
1550 lsaKey.linkStateID = linkStateID;
1551 lsaKey.advertisingRouter = lsa->getHeader().getAdvertisingRouter();
1552 lsaKey.LSType = lsa->getHeader().getLsaType();
1554 for (
long i = 0; i < neighborCount; i++) {
1562 Ospfv3LsaHeader *requestLSAHeader = this->
neighbors.at(i)->findOnRequestList(lsaKey);
1563 if (requestLSAHeader !=
nullptr) {
1566 if (lsa->getHeader() < (*requestLSAHeader)) {
1570 if (
operator==(lsa->getHeader(), (*requestLSAHeader))) {
1572 this->
neighbors.at(i)->removeFromRequestList(lsaKey);
1575 this->
neighbors.at(i)->removeFromRequestList(lsaKey);
1578 if (neighbor == this->
neighbors.at(i)) {
1583 this->
neighbors.at(i)->addToRetransmissionList(lsa);
1584 lsaAddedToRetransmissionList =
true;
1586 if (lsaAddedToRetransmissionList) {
1587 EV_DEBUG <<
"lsaAddedToRetransmissionList true\n";
1588 if ((interface !=
this) ||
1589 ((neighbor !=
nullptr) &&
1590 (neighbor->getNeighborID() != this->getDesignatedID()) &&
1591 (neighbor->getNeighborID() != this->getBackupID())))
1593 EV_DEBUG <<
"step 3 passed\n";
1595 EV_DEBUG <<
"step 4 passed\n";
1597 std::vector<Ospfv3Lsa *> lsas;
1598 Ospfv3Lsa *lsaCopy = lsa->dup();
1599 lsas.push_back(lsaCopy);
1603 if (updatePacket !=
nullptr) {
1604 EV_DEBUG <<
"Prepared LSUpdate packet is ready\n";
1612 EV_DEBUG <<
"Sending LSUpdate packet\n";
1614 for (
long k = 0;
k < neighborCount;
k++) {
1615 this->
neighbors.at(
k)->addToTransmittedLSAList(lsaKey);
1616 if (!this->
neighbors.at(
k)->isUpdateRetransmissionTimerActive()) {
1617 EV_DEBUG <<
"The timer need to be active\n";
1618 this->
neighbors.at(
k)->startUpdateRetransmissionTimer();
1623 EV_DEBUG <<
"Sending packet from floodLSA\n";
1627 if (dRouter !=
nullptr) {
1628 dRouter->addToTransmittedLSAList(lsaKey);
1629 if (!dRouter->isUpdateRetransmissionTimerActive()) {
1630 dRouter->startUpdateRetransmissionTimer();
1633 if (dRouter != backupDRouter && backupDRouter !=
nullptr) {
1634 backupDRouter->addToTransmittedLSAList(lsaKey);
1635 if (!backupDRouter->isUpdateRetransmissionTimerActive()) {
1636 backupDRouter->startUpdateRetransmissionTimer();
1644 if (neighborCount > 0) {
1645 this->
neighbors.at(0)->addToTransmittedLSAList(lsaKey);
1646 if (!this->
neighbors.at(0)->isUpdateRetransmissionTimerActive()) {
1647 this->
neighbors.at(0)->startUpdateRetransmissionTimer();
1652 for (
long m = 0;
m < neighborCount;
m++) {
1655 this->
neighbors.at(
m)->addToTransmittedLSAList(lsaKey);
1656 if (!this->
neighbors.at(
m)->isUpdateRetransmissionTimerActive()) {
1657 this->
neighbors.at(
m)->startUpdateRetransmissionTimer();
1663 if (interface ==
this) {
1664 floodedBackOut =
true;
1672 return floodedBackOut;
Referenced by ageDatabase().
◆ getAckDelay()
| short inet::ospfv3::Ospfv3Interface::getAckDelay |
( |
| ) |
const |
|
inline |
◆ getAcknowledgementTimer()
| cMessage* inet::ospfv3::Ospfv3Interface::getAcknowledgementTimer |
( |
| ) |
|
|
inline |
◆ getArea()
| Ospfv3Area* inet::ospfv3::Ospfv3Interface::getArea |
( |
| ) |
const |
|
inline |
Referenced by acknowledgeLSA(), addDelayedAcknowledgement(), ageDatabase(), inet::ospfv3::Ospfv3InterfaceState::calculateDesignatedRouter(), inet::ospfv3::Ospfv3NeighborState::changeState(), inet::ospfv3::Ospfv3InterfaceState::changeState(), inet::ospfv3::Ospfv3Neighbor::clearRequestRetransmissionTimer(), inet::ospfv3::Ospfv3Neighbor::clearUpdateRetransmissionTimer(), inet::ospfv3::Ospfv3Neighbor::createDatabaseSummary(), detailedInfo(), inet::ospfv3::Ospfv3Process::floodLSA(), floodLSA(), installLinkLSA(), inet::ospfv3::Ospfv3Neighbor::needAdjacency(), originateLinkLSA(), prepareHello(), prepareLSUHeader(), prepareUpdatePacket(), preProcessDDPacket(), processDDPacket(), inet::ospfv3::Ospfv3InterfaceStateDown::processEvent(), inet::ospfv3::Ospfv3NeighborStateAttempt::processEvent(), inet::ospfv3::Ospfv3NeighborStateFull::processEvent(), inet::ospfv3::Ospfv3NeighborStateLoading::processEvent(), inet::ospfv3::Ospfv3NeighborStateExchange::processEvent(), inet::ospfv3::Ospfv3NeighborState2Way::processEvent(), inet::ospfv3::Ospfv3NeighborStateDown::processEvent(), inet::ospfv3::Ospfv3NeighborStateExStart::processEvent(), inet::ospfv3::Ospfv3InterfaceStateDr::processEvent(), inet::ospfv3::Ospfv3InterfaceStateDrOther::processEvent(), inet::ospfv3::Ospfv3NeighborStateInit::processEvent(), inet::ospfv3::Ospfv3InterfaceStateWaiting::processEvent(), inet::ospfv3::Ospfv3InterfaceStatePointToPoint::processEvent(), inet::ospfv3::Ospfv3InterfaceStateBackup::processEvent(), processHelloPacket(), processLSR(), processLSU(), inet::ospfv3::Ospfv3Neighbor::reset(), inet::ospfv3::Ospfv3Neighbor::retransmitDatabaseDescriptionPacket(), inet::ospfv3::Ospfv3Neighbor::retransmitUpdatePacket(), inet::ospfv3::Ospfv3Neighbor::sendDDPacket(), sendDelayedAcknowledgements(), inet::ospfv3::Ospfv3Neighbor::sendLinkStateRequestPacket(), sendLSAcknowledgement(), inet::ospfv3::Ospfv3Neighbor::startRequestRetransmissionTimer(), inet::ospfv3::Ospfv3Neighbor::startUpdateRetransmissionTimer(), ~Ospfv3Interface(), and inet::ospfv3::Ospfv3Neighbor::~Ospfv3Neighbor().
◆ getBackupID()
| Ipv4Address inet::ospfv3::Ospfv3Interface::getBackupID |
( |
| ) |
const |
|
inline |
◆ getBackupIP()
| Ipv6Address inet::ospfv3::Ospfv3Interface::getBackupIP |
( |
| ) |
const |
|
inline |
◆ getCurrentState()
145 {
return this->
state; };
◆ getDeadInterval()
| short inet::ospfv3::Ospfv3Interface::getDeadInterval |
( |
| ) |
const |
|
inline |
Referenced by inet::ospfv3::Ospfv3Instance::detailedInfo(), detailedInfo(), prepareHello(), inet::ospfv3::Ospfv3InterfaceStateDown::processEvent(), inet::ospfv3::Ospfv3NeighborStateFull::processEvent(), inet::ospfv3::Ospfv3NeighborStateLoading::processEvent(), inet::ospfv3::Ospfv3NeighborState2Way::processEvent(), inet::ospfv3::Ospfv3NeighborStateExchange::processEvent(), inet::ospfv3::Ospfv3NeighborStateInit::processEvent(), inet::ospfv3::Ospfv3NeighborStateExStart::processEvent(), inet::ospfv3::Ospfv3InterfaceStateDr::processEvent(), inet::ospfv3::Ospfv3InterfaceStateBackup::processEvent(), and processHelloPacket().
◆ getDesignatedID()
| Ipv4Address inet::ospfv3::Ospfv3Interface::getDesignatedID |
( |
| ) |
const |
|
inline |
◆ getDesignatedIntID()
| int inet::ospfv3::Ospfv3Interface::getDesignatedIntID |
( |
| ) |
const |
|
inline |
◆ getDesignatedIP()
| Ipv6Address inet::ospfv3::Ospfv3Interface::getDesignatedIP |
( |
| ) |
const |
|
inline |
◆ getHelloInterval()
| short inet::ospfv3::Ospfv3Interface::getHelloInterval |
( |
| ) |
const |
|
inline |
◆ getHelloTimer()
| cMessage* inet::ospfv3::Ospfv3Interface::getHelloTimer |
( |
| ) |
|
|
inline |
◆ getInterfaceAddress()
◆ getInterfaceAddressCount()
| int inet::ospfv3::Ospfv3Interface::getInterfaceAddressCount |
( |
| ) |
|
|
inline |
◆ getInterfaceCost()
| int inet::ospfv3::Ospfv3Interface::getInterfaceCost |
( |
| ) |
const |
|
inline |
◆ getInterfaceId()
| int inet::ospfv3::Ospfv3Interface::getInterfaceId |
( |
| ) |
const |
|
inline |
◆ getInterfaceIndex() [1/2]
| int inet::ospfv3::Ospfv3Interface::getInterfaceIndex |
( |
| ) |
|
|
inline |
◆ getInterfaceIndex() [2/2]
| int inet::ospfv3::Ospfv3Interface::getInterfaceIndex |
( |
| ) |
const |
|
inline |
◆ getInterfaceLLIP()
| Ipv6Address inet::ospfv3::Ospfv3Interface::getInterfaceLLIP |
( |
| ) |
const |
|
inline |
◆ getInterfaceMTU()
| int inet::ospfv3::Ospfv3Interface::getInterfaceMTU |
( |
| ) |
const |
◆ getIntName()
| std::string inet::ospfv3::Ospfv3Interface::getIntName |
( |
| ) |
const |
|
inline |
Referenced by acknowledgeLSA(), inet::ospfv3::Ospfv3Area::addInterface(), inet::ospfv3::Ospfv3InterfaceState::changeState(), inet::ospfv3::Ospfv3Instance::detailedInfo(), detailedInfo(), floodLSA(), inet::ospfv3::Ospfv3Area::originateNetIntraAreaPrefixLSA(), inet::ospfv3::Ospfv3InterfaceStateDown::processEvent(), inet::ospfv3::Ospfv3NeighborStateDown::processEvent(), inet::ospfv3::Ospfv3InterfaceStateDr::processEvent(), inet::ospfv3::Ospfv3InterfaceStateDrOther::processEvent(), inet::ospfv3::Ospfv3InterfaceStateWaiting::processEvent(), inet::ospfv3::Ospfv3InterfaceStatePointToPoint::processEvent(), inet::ospfv3::Ospfv3InterfaceStateBackup::processEvent(), processHelloPacket(), processLSR(), reset(), sendDelayedAcknowledgements(), sendLSAcknowledgement(), and str().
◆ getLinkLSA()
| LinkLSA* inet::ospfv3::Ospfv3Interface::getLinkLSA |
( |
int |
i | ) |
|
|
inline |
◆ getLinkLSAbyKey()
1816 for (
auto it = this->
linkLSAList.begin(); it != this->linkLSAList.end(); it++) {
1817 if (((*it)->getHeader().getAdvertisingRouter() == lsaKey.advertisingRouter) && (*it)->getHeader().getLinkStateID() == lsaKey.linkStateID) {
Referenced by installLinkLSA().
◆ getLinkLSACount()
| int inet::ospfv3::Ospfv3Interface::getLinkLSACount |
( |
| ) |
|
|
inline |
◆ getNeighbor()
Referenced by inet::ospfv3::Ospfv3InterfaceState::calculateDesignatedRouter(), inet::ospfv3::Ospfv3Instance::detailedInfo(), inet::ospfv3::Ospfv3Process::handleTimer(), inet::ospfv3::Ospfv3Area::originateNetworkLSA(), inet::ospfv3::Ospfv3Area::originateRouterLSA(), prepareHello(), inet::ospfv3::Ospfv3InterfaceStateDown::processEvent(), inet::ospfv3::Ospfv3InterfaceStateDr::processEvent(), inet::ospfv3::Ospfv3InterfaceStateDrOther::processEvent(), inet::ospfv3::Ospfv3InterfaceStateWaiting::processEvent(), inet::ospfv3::Ospfv3InterfaceStatePointToPoint::processEvent(), inet::ospfv3::Ospfv3InterfaceStateBackup::processEvent(), and removeNeighborByID().
◆ getNeighborById()
◆ getNeighborCount()
| int inet::ospfv3::Ospfv3Interface::getNeighborCount |
( |
| ) |
const |
|
inline |
Referenced by inet::ospfv3::Ospfv3Area::ageDatabase(), inet::ospfv3::Ospfv3InterfaceState::calculateDesignatedRouter(), inet::ospfv3::Ospfv3Instance::detailedInfo(), detailedInfo(), floodLSA(), inet::ospfv3::Ospfv3Process::handleTimer(), isOnAnyRetransmissionList(), inet::ospfv3::Ospfv3Area::originateNetworkLSA(), inet::ospfv3::Ospfv3Area::originateRouterLSA(), prepareHello(), inet::ospfv3::Ospfv3InterfaceStateDown::processEvent(), inet::ospfv3::Ospfv3NeighborStateDown::processEvent(), inet::ospfv3::Ospfv3InterfaceStateDr::processEvent(), inet::ospfv3::Ospfv3InterfaceStateDrOther::processEvent(), inet::ospfv3::Ospfv3InterfaceStateWaiting::processEvent(), inet::ospfv3::Ospfv3InterfaceStatePointToPoint::processEvent(), inet::ospfv3::Ospfv3InterfaceStateBackup::processEvent(), processHelloPacket(), removeFromAllRetransmissionLists(), and removeNeighborByID().
◆ getPollInterval()
| short inet::ospfv3::Ospfv3Interface::getPollInterval |
( |
| ) |
const |
|
inline |
◆ getPreviousState()
◆ getRetransmissionInterval()
| short inet::ospfv3::Ospfv3Interface::getRetransmissionInterval |
( |
| ) |
const |
|
inline |
◆ getRouterPriority()
| int inet::ospfv3::Ospfv3Interface::getRouterPriority |
( |
| ) |
const |
|
inline |
◆ getState()
Referenced by acknowledgeLSA(), addDelayedAcknowledgement(), inet::ospfv3::Ospfv3Area::ageDatabase(), inet::ospfv3::Ospfv3InterfaceState::calculateDesignatedRouter(), inet::ospfv3::Ospfv3NeighborState::changeState(), detailedInfo(), floodLSA(), inet::ospfv3::Ospfv3Area::originateRouterLSA(), prepareHello(), processHelloPacket(), processLSR(), processLSU(), inet::ospfv3::Ospfv3Instance::processPacket(), and sendDelayedAcknowledgements().
◆ getTransDelayInterval()
| short inet::ospfv3::Ospfv3Interface::getTransDelayInterval |
( |
| ) |
const |
|
inline |
◆ getTransitAreaID()
| Ipv4Address inet::ospfv3::Ospfv3Interface::getTransitAreaID |
( |
| ) |
const |
|
inline |
◆ getTransitNetInt()
| bool inet::ospfv3::Ospfv3Interface::getTransitNetInt |
( |
| ) |
|
|
inline |
◆ getType()
Referenced by acknowledgeLSA(), inet::ospfv3::Ospfv3Area::ageDatabase(), inet::ospfv3::Ospfv3InterfaceState::changeState(), detailedInfo(), inet::ospfv3::Ospfv3Neighbor::needAdjacency(), inet::ospfv3::Ospfv3Area::originateRouterLSA(), inet::ospfv3::Ospfv3InterfaceStateDown::processEvent(), inet::ospfv3::Ospfv3NeighborStateAttempt::processEvent(), inet::ospfv3::Ospfv3NeighborStateFull::processEvent(), inet::ospfv3::Ospfv3NeighborStateLoading::processEvent(), inet::ospfv3::Ospfv3NeighborStateDown::processEvent(), inet::ospfv3::Ospfv3NeighborStateExchange::processEvent(), inet::ospfv3::Ospfv3NeighborState2Way::processEvent(), inet::ospfv3::Ospfv3InterfaceStateDrOther::processEvent(), inet::ospfv3::Ospfv3NeighborStateInit::processEvent(), inet::ospfv3::Ospfv3InterfaceStateDr::processEvent(), inet::ospfv3::Ospfv3NeighborStateExStart::processEvent(), inet::ospfv3::Ospfv3InterfaceStateWaiting::processEvent(), inet::ospfv3::Ospfv3InterfaceStatePointToPoint::processEvent(), inet::ospfv3::Ospfv3InterfaceStateBackup::processEvent(), processLSR(), and processLSU().
◆ getWaitTimer()
| cMessage* inet::ospfv3::Ospfv3Interface::getWaitTimer |
( |
| ) |
|
|
inline |
◆ hasAnyNeighborInState()
| bool inet::ospfv3::Ospfv3Interface::hasAnyNeighborInState |
( |
int |
state | ) |
const |
◆ installLinkLSA()
| bool inet::ospfv3::Ospfv3Interface::installLinkLSA |
( |
const Ospfv3LinkLsa * |
lsa | ) |
|
◆ isInterfacePassive()
| bool inet::ospfv3::Ospfv3Interface::isInterfacePassive |
( |
| ) |
|
|
inline |
◆ isOnAnyRetransmissionList()
| bool inet::ospfv3::Ospfv3Interface::isOnAnyRetransmissionList |
( |
LSAKeyType |
lsaKey | ) |
const |
1686 for (
long i = 0; i < neighborCount; i++) {
1687 if (
neighbors[i]->isLinkStateRequestListEmpty(lsaKey)) {
Referenced by ageDatabase().
◆ linkLSADiffersFrom()
1862 const Ospfv3LsaHeader& thisHeader = currentLsa->getHeader();
1863 const Ospfv3LsaHeader& lsaHeader = newLsa->getHeader();
1864 bool differentHeader = (((thisHeader.getLsaAge() ==
MAX_AGE) && (lsaHeader.getLsaAge() !=
MAX_AGE)) ||
1865 ((thisHeader.getLsaAge() !=
MAX_AGE) && (lsaHeader.getLsaAge() ==
MAX_AGE)) ||
1866 (thisHeader.getLsaLength() != lsaHeader.getLsaLength()));
1867 bool differentBody =
false;
1869 if (!differentHeader) {
1870 differentBody = ((currentLsa->getRouterPriority() != newLsa->getRouterPriority()) ||
1871 (currentLsa->getOspfOptions() != newLsa->getOspfOptions()) ||
1872 (currentLsa->getLinkLocalInterfaceAdd() != newLsa->getLinkLocalInterfaceAdd()) ||
1873 (currentLsa->getPrefixesArraySize() != newLsa->getPrefixesArraySize()));
1875 if (!differentBody) {
1876 unsigned int prefixCount = currentLsa->getPrefixesArraySize();
1877 for (
unsigned int i = 0; i < prefixCount; i++) {
1878 auto thisRouter = currentLsa->getPrefixes(i);
1879 auto lsaRouter = newLsa->getPrefixes(i);
1880 bool differentLink = ((thisRouter.prefixLen != lsaRouter.prefixLen) ||
1881 (thisRouter.dnBit != lsaRouter.dnBit) ||
1882 (thisRouter.laBit != lsaRouter.laBit) ||
1883 (thisRouter.nuBit != lsaRouter.nuBit) ||
1884 (thisRouter.xBit != lsaRouter.xBit) ||
1885 (thisRouter.addressPrefix != lsaRouter.addressPrefix) ||
1886 (thisRouter.pBit != lsaRouter.pBit));
1888 if (differentLink) {
1889 differentBody =
true;
1896 return differentHeader || differentBody;
Referenced by updateLinkLSA().
◆ originateLinkLSA()
| LinkLSA * inet::ospfv3::Ospfv3Interface::originateLinkLSA |
( |
| ) |
|
1730 LinkLSA *linkLSA =
new LinkLSA();
1731 Ospfv3LsaHeader& lsaHeader = linkLSA->getHeaderForUpdate();
1734 lsaHeader.setLsaAge(0);
1738 lsaHeader.setAdvertisingRouter(this->
getArea()->getInstance()->getProcess()->getRouterID());
1747 Ospfv3Options lsOptions;
1748 linkLSA->setOspfOptions(lsOptions);
1752 const auto& ipv4Data = ie->getProtocolData<Ipv4InterfaceData>();
1753 Ipv4Address ipAdd = ipv4Data->getIPAddress();
1756 linkLSA->setLinkLocalInterfaceAdd(ipAdd);
1758 Ospfv3LsaPrefix0 prefix;
1759 prefix.dnBit =
false;
1760 prefix.laBit =
false;
1761 prefix.nuBit =
false;
1762 prefix.pBit =
false;
1763 prefix.xBit =
false;
1764 prefix.prefixLen = ipv4Data->getNetmask().getNetmaskLength();
1765 prefix.addressPrefix = L3Address(ipAdd.getPrefix(prefix.prefixLen));
1767 linkLSA->setPrefixesArraySize(1);
1768 linkLSA->setPrefixes(0, prefix);
1770 linkLSA->setNumPrefixes(1);
1773 const auto& ipv6Data = ie->getProtocolData<Ipv6InterfaceData>();
1774 linkLSA->setLinkLocalInterfaceAdd(ipv6Data->getLinkLocalAddress());
1775 int numPrefixes = ipv6Data->getNumAddresses();
1776 for (
int i = 0; i < numPrefixes; i++) {
1777 EV_DEBUG <<
"Creating Link LSA for address: " << ipv6Data->getLinkLocalAddress() <<
"\n";
1778 Ipv6Address ipv6 = ipv6Data->getAddress(i);
1780 if (ipv6.isGlobal()) {
1781 Ospfv3LsaPrefix0 prefix;
1782 prefix.dnBit =
false;
1783 prefix.laBit =
false;
1784 prefix.nuBit =
false;
1785 prefix.pBit =
false;
1786 prefix.xBit =
false;
1792 prefix.prefixLen = 64;
1794 prefix.addressPrefix = ipv6.getPrefix(prefix.prefixLen);
1796 linkLSA->setPrefixesArraySize(linkLSA->getPrefixesArraySize() + 1);
1797 linkLSA->setPrefixes(linkLSA->getPrefixesArraySize() - 1, prefix);
1798 packetLength += 4 * ((prefix.prefixLen + 31) / 32) + 4;
1799 linkLSA->setNumPrefixes(linkLSA->getNumPrefixes() + 1);
1804 lsaHeader.setLsaLength(packetLength);
Referenced by ageDatabase(), and inet::ospfv3::Ospfv3InterfaceStateDown::processEvent().
◆ prepareHello()
| Packet * inet::ospfv3::Ospfv3Interface::prepareHello |
( |
| ) |
|
◆ prepareLSUHeader()
| Packet * inet::ospfv3::Ospfv3Interface::prepareLSUHeader |
( |
| ) |
|
895 EV_DEBUG <<
"Preparing LSU HEADER\n";
896 const auto& updatePacket = makeShared<Ospfv3LinkStateUpdatePacket>();
899 updatePacket->setRouterID(this->
getArea()->getInstance()->getProcess()->getRouterID());
900 updatePacket->setAreaID(this->
getArea()->getAreaID());
901 updatePacket->setInstanceID(this->
getArea()->getInstance()->getInstanceID());
905 updatePacket->setLsaCount(0);
907 Packet *pk =
new Packet();
908 pk->insertAtBack(updatePacket);
◆ prepareUpdatePacket()
| Packet * inet::ospfv3::Ospfv3Interface::prepareUpdatePacket |
( |
std::vector< Ospfv3Lsa * > |
lsas | ) |
|
914 EV_DEBUG <<
"Preparing LSU\n";
915 const auto& updatePacket = makeShared<Ospfv3LinkStateUpdatePacket>();
918 updatePacket->setRouterID(this->
getArea()->getInstance()->getProcess()->getRouterID());
919 updatePacket->setAreaID(this->
getArea()->getAreaID());
920 updatePacket->setInstanceID(this->
getArea()->getInstance()->getInstanceID());
925 updatePacket->setLsaCount(0);
927 for (
size_t j = 0; j < lsas.size(); j++) {
928 Ospfv3Lsa *lsa = lsas[j];
930 int count = updatePacket->getLsaCount();
935 uint16_t code = lsa->getHeader().getLsaType();
939 int pos = updatePacket->getRouterLSAsArraySize();
940 Ospfv3RouterLsa *routerLSA =
dynamic_cast<Ospfv3RouterLsa *
>(lsa);
941 updatePacket->setRouterLSAsArraySize(pos + 1);
942 updatePacket->setRouterLSAs(pos, *routerLSA);
943 updatePacket->setLsaCount(
count + 1);
945 updatePacket->setPacketLengthField(packetLength.get());
946 updatePacket->setChunkLength(packetLength);
950 int pos = updatePacket->getNetworkLSAsArraySize();
951 Ospfv3NetworkLsa *networkLSA =
dynamic_cast<Ospfv3NetworkLsa *
>(lsa);
952 updatePacket->setNetworkLSAsArraySize(pos + 1);
953 updatePacket->setNetworkLSAs(pos, *networkLSA);
954 updatePacket->setLsaCount(
count + 1);
956 updatePacket->setPacketLengthField(packetLength.get());
957 updatePacket->setChunkLength(
B(packetLength));
962 int pos = updatePacket->getInterAreaPrefixLSAsArraySize();
963 Ospfv3InterAreaPrefixLsa *prefixLSA =
dynamic_cast<Ospfv3InterAreaPrefixLsa *
>(lsa);
964 updatePacket->setInterAreaPrefixLSAsArraySize(pos + 1);
965 updatePacket->setInterAreaPrefixLSAs(pos, *prefixLSA);
966 updatePacket->setLsaCount(
count + 1);
968 updatePacket->setPacketLengthField(packetLength.get());
969 updatePacket->setChunkLength(packetLength);
986 int pos = updatePacket->getLinkLSAsArraySize();
987 Ospfv3LinkLsa *linkLSA =
dynamic_cast<Ospfv3LinkLsa *
>(lsa);
988 updatePacket->setLinkLSAsArraySize(pos + 1);
989 updatePacket->setLinkLSAs(pos, *linkLSA);
990 updatePacket->setLsaCount(
count + 1);
992 updatePacket->setPacketLengthField(packetLength.get());
993 updatePacket->setChunkLength(packetLength);
998 int pos = updatePacket->getIntraAreaPrefixLSAsArraySize();
999 Ospfv3IntraAreaPrefixLsa *prefixLSA =
dynamic_cast<Ospfv3IntraAreaPrefixLsa *
>(lsa);
1000 updatePacket->setIntraAreaPrefixLSAsArraySize(pos + 1);
1001 updatePacket->setIntraAreaPrefixLSAs(pos, *prefixLSA);
1002 updatePacket->setLsaCount(
count + 1);
1004 updatePacket->setPacketLengthField(packetLength.get());
1005 updatePacket->setChunkLength(packetLength);
1010 Packet *pk =
new Packet();
1011 pk->insertAtBack(updatePacket);
Referenced by floodLSA(), and processLSR().
◆ preProcessDDPacket()
| bool inet::ospfv3::Ospfv3Interface::preProcessDDPacket |
( |
Packet * |
packet, |
|
|
Ospfv3Neighbor * |
neighbor, |
|
|
bool |
inExchangeStart |
|
) |
| |
752 const auto& ddPacket = packet->peekAtFront<Ospfv3DatabaseDescriptionPacket>();
753 EV_INFO <<
" Processing packet contents(ddOptions="
754 << ((ddPacket->getDdOptions().iBit) ?
"I " :
"_ ")
755 << ((ddPacket->getDdOptions().mBit) ?
"M " :
"_ ")
756 << ((ddPacket->getDdOptions().msBit) ?
"MS" :
"__")
758 << ddPacket->getSequenceNumber()
761 unsigned int headerCount = ddPacket->getLsaHeadersArraySize();
763 for (
unsigned int i = 0; i < headerCount; i++) {
764 const Ospfv3LsaHeader& currentHeader = ddPacket->getLsaHeaders(i);
765 uint16_t lsaType = currentHeader.getLsaType();
771 EV_ERROR <<
" Error! LSA TYPE: " << lsaType <<
"\n";
776 EV_DEBUG <<
"Trying to locate LSA in database\n";
779 lsaKey.linkStateID = currentHeader.getLinkStateID();
780 lsaKey.advertisingRouter = currentHeader.getAdvertisingRouter();
781 lsaKey.LSType = currentHeader.getLsaType();
783 const Ospfv3LsaHeader *lsaInDatabase = this->
getArea()->
findLSA(lsaKey);
786 if ((lsaInDatabase ==
nullptr) || (*lsaInDatabase < currentHeader)) {
787 EV_DETAIL <<
" (newer)";
788 EV_DEBUG <<
"Adding LSA from router " << currentHeader.
getAdvertisingRouter() <<
"on request list\n";
789 neighbor->addToRequestList(¤tHeader);
795 EV_DEBUG <<
"DatabaseSummaryListCount = " << neighbor->getDatabaseSummaryListCount() << endl;
796 EV_DEBUG <<
"M_BIT " << ddPacket->getDdOptions().mBit << endl;
798 EV_DEBUG <<
"I am the master!\n";
799 neighbor->incrementDDSequenceNumber();
800 if ((neighbor->getDatabaseSummaryListCount() == 0) && !ddPacket->getDdOptions().mBit) {
801 EV_DEBUG <<
"Passing EXCHANGE_DONE to neighbor\n";
805 if (!inExchangeStart) {
806 EV_DEBUG <<
"Sending packet\n";
807 neighbor->sendDDPacket();
812 neighbor->setDDSequenceNumber(ddPacket->getSequenceNumber());
813 if (!inExchangeStart) {
814 neighbor->sendDDPacket();
816 if (!ddPacket->getDdOptions().mBit &&
817 (neighbor->getDatabaseSummaryListCount() == 0))
Referenced by processDDPacket().
◆ processDDPacket()
| void inet::ospfv3::Ospfv3Interface::processDDPacket |
( |
Packet * |
packet | ) |
|
557 const auto& ddPacket = packet->peekAtFront<Ospfv3DatabaseDescriptionPacket>();
560 Ospfv3Neighbor *neighbor = this->
getNeighborById(ddPacket->getRouterID());
561 if (neighbor ==
nullptr)
562 EV_DEBUG <<
"DD Packet is originated by an unknown router - it is not listed as a neighbor\n";
565 if ((ddPacket->getInterfaceMTU() <= this->getInterfaceMTU()) &&
568 switch (neighborState) {
570 EV_DEBUG <<
"Parsing DD Packet - two way state - throwing away\n";
577 EV_DEBUG <<
"Parsing DD Packet - init -> goint to 2way\n";
578 Ospfv3DdPacketId packetID;
579 packetID.ddOptions = ddPacket->getDdOptions();
580 packetID.options = ddPacket->getOptions();
581 packetID.sequenceNumber = ddPacket->getSequenceNumber();
584 neighbor->setLastReceivedDDPacket(packetID);
591 const Ospfv3DdOptions& ddOptions = ddPacket->getDdOptions();
593 if (ddOptions.iBit && ddOptions.mBit && ddOptions.msBit &&
594 (ddPacket->getLsaHeadersArraySize() == 0))
596 if (neighbor->getNeighborID() > this->getArea()->getInstance()->getProcess()->getRouterID()) {
599 Ospfv3DdPacketId packetID;
600 packetID.ddOptions = ddPacket->getDdOptions();
601 packetID.options = ddPacket->getOptions();
602 packetID.sequenceNumber = ddPacket->getSequenceNumber();
605 neighbor->setLastReceivedDDPacket(packetID);
612 EV_DEBUG <<
"Router going to negotiation done state\n";
613 EV_DEBUG <<
"LinkStateRequestEmpty = " << neighbor->isLinkStateRequestListEmpty() <<
", retransmission timer active = " << neighbor->isRequestRetransmissionTimerActive() <<
"\n";
614 if (!neighbor->isLinkStateRequestListEmpty() &&
615 !neighbor->isRequestRetransmissionTimerActive())
617 neighbor->sendLinkStateRequestPacket();
618 neighbor->clearRequestRetransmissionTimer();
619 neighbor->startRequestRetransmissionTimer();
623 neighbor->sendDDPacket(
true);
627 if (!ddOptions.iBit && !ddOptions.msBit &&
628 (ddPacket->getSequenceNumber() == neighbor->getDDSequenceNumber()) &&
629 (neighbor->getNeighborID() < this->getArea()->getInstance()->getProcess()->getRouterID()))
631 Ospfv3DdPacketId packetID;
632 packetID.ddOptions = ddPacket->getDdOptions();
633 packetID.options = ddPacket->getOptions();
634 packetID.sequenceNumber = ddPacket->getSequenceNumber();
637 neighbor->setLastReceivedDDPacket(packetID);
644 if (!neighbor->isLinkStateRequestListEmpty() &&
645 !neighbor->isRequestRetransmissionTimerActive())
647 neighbor->sendLinkStateRequestPacket();
648 neighbor->clearRequestRetransmissionTimer();
649 neighbor->startRequestRetransmissionTimer();
657 EV_DEBUG <<
"Parsing DD Packet - EXCHANGE STATE\n";
658 Ospfv3DdPacketId packetID;
659 packetID.ddOptions = ddPacket->getDdOptions();
660 packetID.options = ddPacket->getOptions();
661 packetID.sequenceNumber = ddPacket->getSequenceNumber();
663 if (packetID != neighbor->getLastReceivedDDPacket()) {
664 if ((packetID.ddOptions.msBit &&
666 (!packetID.ddOptions.msBit &&
668 packetID.ddOptions.iBit ||
669 (packetID.options != neighbor->getLastReceivedDDPacket().options))
671 EV_DEBUG <<
"Last DD Sequence is : " << neighbor->getLastReceivedDDPacket().sequenceNumber <<
"\n";
676 (packetID.sequenceNumber == neighbor->getDDSequenceNumber())) ||
678 (packetID.sequenceNumber == (neighbor->getDDSequenceNumber() + 1))))
681 neighbor->setLastReceivedDDPacket(packetID);
683 EV_DEBUG <<
"Parsing DD Packet - EXCHANGE - preprocessing was true \n";
686 if (!neighbor->isLinkStateRequestListEmpty() &&
687 !neighbor->isRequestRetransmissionTimerActive())
689 EV_DEBUG <<
"Parsing DD Packet - sending LINKSTATEREQUEST\n";
690 neighbor->sendLinkStateRequestPacket();
691 neighbor->clearRequestRetransmissionTimer();
692 neighbor->startRequestRetransmissionTimer();
701 EV_DEBUG <<
"Received DD was the same as the last one\n";
703 EV_DEBUG <<
"But I am a slave so I retransmit it\n";
704 neighbor->retransmitDatabaseDescriptionPacket();
713 Ospfv3DdPacketId packetID;
714 packetID.ddOptions = ddPacket->getDdOptions();
715 packetID.options = ddPacket->getOptions();
716 packetID.sequenceNumber = ddPacket->getSequenceNumber();
718 if ((packetID != neighbor->getLastReceivedDDPacket()) ||
719 (packetID.ddOptions.iBit))
721 EV_DEBUG <<
" Processing packet contents(ddOptions="
722 << ((ddPacket->getDdOptions().iBit) ?
"I " :
"_ ")
723 << ((ddPacket->getDdOptions().mBit) ?
"M " :
"_ ")
724 << ((ddPacket->getDdOptions().msBit) ?
"MS" :
"__")
726 << ddPacket->getSequenceNumber()
733 if (!neighbor->retransmitDatabaseDescriptionPacket()) {
Referenced by inet::ospfv3::Ospfv3Instance::processPacket().
◆ processEvent()
◆ processHelloPacket()
| void inet::ospfv3::Ospfv3Interface::processHelloPacket |
( |
Packet * |
packet | ) |
|
290 EV_DEBUG <<
"Hello packet was received on interface " << this->
getIntName() <<
"\n";
291 const auto& hello = packet->peekAtFront<Ospfv3HelloPacket>();
292 bool neighborChanged =
false;
293 bool backupSeen =
false;
295 bool neighborsDRStateChanged =
false;
296 bool drChanged =
false;
297 bool shouldRebuildRoutingTable =
false;
301 Ipv4Address sourceId = hello->getRouterID();
304 if (neighbor !=
nullptr) {
305 EV_DEBUG <<
"This is not a new neighbor!!! I know him for a long time...\n";
306 Ipv4Address designatedRouterID = neighbor->getNeighborsDR();
307 Ipv4Address backupRouterID = neighbor->getNeighborsBackup();
308 int newPriority = hello->getRouterPriority();
309 Ipv4Address newDesignatedRouterID = hello->getDesignatedRouterID();
310 Ipv4Address newBackupRouterID = hello->getBackupDesignatedRouterID();
311 Ipv4Address dRouterID;
313 if ((this->
interfaceType == Ospfv3InterfaceType::VIRTUAL_TYPE) &&
316 neighbor->setNeighborPriority(hello->getRouterPriority());
317 neighbor->setNeighborDeadInterval(hello->getDeadInterval());
324 if (neighbor->getNeighborPriority() != newPriority) {
325 neighborChanged =
true;
335 if ((newDesignatedRouterID == sourceId) &&
337 (this->
getState() == Ospfv3InterfaceFaState::INTERFACE_STATE_WAITING))
348 if (((newDesignatedRouterID == sourceId) &&
349 (newDesignatedRouterID != designatedRouterID)) ||
350 ((newDesignatedRouterID != sourceId) &&
351 (sourceId == designatedRouterID)))
353 neighborChanged =
true;
354 neighborsDRStateChanged =
true;
373 if ((newBackupRouterID == sourceId) &&
374 (this->
getState() == Ospfv3InterfaceFaState::INTERFACE_STATE_WAITING))
385 if (((newBackupRouterID == sourceId) &&
386 (newBackupRouterID != backupRouterID)) ||
387 ((newBackupRouterID != sourceId) &&
388 (sourceId == backupRouterID)))
390 neighborChanged =
true;
394 neighbor->setNeighborID(hello->getRouterID());
395 neighbor->setNeighborPriority(newPriority);
396 neighbor->setNeighborAddress(packet->getTag<
L3AddressInd>()->getSrcAddress().toIpv6());
397 neighbor->setNeighborInterfaceID(hello->getInterfaceID());
398 dRouterID = newDesignatedRouterID;
399 if (newDesignatedRouterID != designatedRouterID) {
400 designatedRouterID = dRouterID;
404 neighbor->setDesignatedRouterID(dRouterID);
405 dRouterID = newBackupRouterID;
406 if (newBackupRouterID != backupRouterID) {
407 backupRouterID = dRouterID;
411 neighbor->setBackupDesignatedRouterID(dRouterID);
413 neighbor->setupDesignatedRouters(
false);
420 if (!neighbor->designatedRoutersAreSetUp()) {
421 Ospfv3Neighbor *designated = this->
getNeighborById(designatedRouterID);
424 if (designated !=
nullptr) {
425 dRouterID = designated->getNeighborID();
426 neighbor->setDesignatedRouterID(dRouterID);
428 if (backup !=
nullptr) {
429 dRouterID = backup->getNeighborID();
430 neighbor->setBackupDesignatedRouterID(dRouterID);
432 if ((designated !=
nullptr) && (backup !=
nullptr)) {
433 neighbor->setupDesignatedRouters(
true);
437 neighbor->setLastHelloTime((
int)simTime().dbl());
440 Ipv4Address dRouterID;
441 bool designatedSetUp =
false;
442 bool backupSetUp =
false;
444 neighbor =
new Ospfv3Neighbor(sourceId,
this);
445 neighbor->setNeighborPriority(hello->getRouterPriority());
446 neighbor->setNeighborAddress(packet->getTag<
L3AddressInd>()->getSrcAddress().toIpv6());
447 neighbor->setNeighborDeadInterval(hello->getDeadInterval());
448 neighbor->setNeighborInterfaceID(hello->getInterfaceID());
450 dRouterID = hello->getDesignatedRouterID();
454 if (designated !=
nullptr) {
455 if (designated->getNeighborID() != dRouterID) {
456 dRouterID = designated->getNeighborID();
458 designatedSetUp =
true;
460 neighbor->setDesignatedRouterID(dRouterID);
462 dRouterID = hello->getBackupDesignatedRouterID();
466 if (backup !=
nullptr) {
467 if (backup->getNeighborID() != dRouterID) {
468 dRouterID = backup->getNeighborID();
472 neighbor->setBackupDesignatedRouterID(dRouterID);
473 if (designatedSetUp && backupSetUp) {
474 neighbor->setupDesignatedRouters(
true);
478 if ((this->
getState() == Ospfv3InterfaceFaState::INTERFACE_STATE_DESIGNATED ||
479 this->
getState() == Ospfv3InterfaceFaState::INTERFACE_STATE_BACKUP)
488 neighbor->processEvent(Ospfv3Neighbor::Ospfv3NeighborEventType::HELLO_RECEIVED);
489 if ((this->
interfaceType == Ospfv3InterfaceType::NBMA_TYPE) &&
491 (neighbor->getState() >= Ospfv3Neighbor::Ospfv3NeighborStateType::INIT_STATE))
497 unsigned int neighborsNeighborCount = hello->getNeighborIDArraySize();
500 for (i = 0; i < neighborsNeighborCount; i++) {
501 if (hello->getNeighborID(i) == this->getArea()->getInstance()->getProcess()->getRouterID()) {
511 if (i == neighborsNeighborCount) {
515 if (neighborChanged) {
516 EV_DEBUG <<
"Neighbor change noted in Hello packet\n";
517 this->
processEvent(Ospfv3InterfaceEvent::NEIGHBOR_CHANGE_EVENT);
529 for (i = 0; i < neighborCount; i++) {
530 Ospfv3Neighbor *stuckNeighbor = this->
neighbors.at(i);
536 if (neighborsDRStateChanged) {
537 EV_DEBUG <<
"Router DR has changed - need to add LSAs\n";
538 shouldRebuildRoutingTable =
true;
544 if (shouldRebuildRoutingTable) {
Referenced by inet::ospfv3::Ospfv3Instance::processPacket().
◆ processLSAck()
1290 const auto& lsAckPacket = packet->peekAtFront<Ospfv3LinkStateAcknowledgementPacket>();
1292 int lsaCount = lsAckPacket->getLsaHeadersArraySize();
1294 EV_DETAIL <<
" Link State Acknowledgement Processing packet contents:\n";
1296 for (
int i = 0; i < lsaCount; i++) {
1297 const Ospfv3LsaHeader& lsaHeader = lsAckPacket->getLsaHeaders(i);
1298 Ospfv3Lsa *lsaOnRetransmissionList;
1300 lsaKey.linkStateID = lsaHeader.getLinkStateID();
1301 lsaKey.advertisingRouter = lsaHeader.getAdvertisingRouter();
1303 if ((lsaOnRetransmissionList = neighbor->findOnRetransmissionList(lsaKey)) !=
nullptr) {
1304 if (
operator==(lsaHeader, lsaOnRetransmissionList->getHeader())) {
1305 EV_DEBUG <<
"neighbor->removeFromRetransmissionList(lsaKey)\n";
1306 neighbor->removeFromRetransmissionList(lsaKey);
1309 EV_INFO <<
"Got an Acknowledgement packet for an unsent Update packet.\n";
1313 if (neighbor->isRetransmissionListEmpty()) {
1314 EV_DEBUG <<
"neighbor clear Update Retransmission Timer\n";
1315 neighbor->clearUpdateRetransmissionTimer();
Referenced by inet::ospfv3::Ospfv3Instance::processPacket().
◆ processLSR()
829 const auto& lsr = packet->peekAtFront<Ospfv3LinkStateRequestPacket>();
830 EV_DEBUG <<
"Processing LSR Packet from " << lsr->getRouterID() <<
"\n";
832 std::vector<Ospfv3Lsa *> lsas;
839 for (
unsigned int i = 0; i < lsr->getRequestsArraySize(); i++) {
840 const Ospfv3LsRequest& request = lsr->getRequests(i);
843 lsaKey.LSType = request.lsaType;
844 lsaKey.linkStateID = request.lsaID;
845 lsaKey.advertisingRouter = request.advertisingRouter;
849 if (lsaInDatabase !=
nullptr) {
850 lsas.push_back(lsaInDatabase);
854 EV_DEBUG <<
"Somehow I got here...BAD_LINK_STATE_REQUEST\n ";
864 if (updatePacket !=
nullptr) {
Referenced by inet::ospfv3::Ospfv3Instance::processPacket().
◆ processLSU()
1018 const auto& lsUpdatePacket = packet->peekAtFront<Ospfv3LinkStateUpdatePacket>();
1019 bool rebuildRoutingTable =
false;
1022 EV_DEBUG <<
"Processing LSU from " << lsUpdatePacket->getRouterID() <<
"\n";
1024 Ipv4Address areaID = lsUpdatePacket->getAreaID();
1028 unsigned int lsaCount = 0;
1029 switch (currentType) {
1031 lsaCount = lsUpdatePacket->getRouterLSAsArraySize();
1032 EV_DEBUG <<
"Parsing ROUTER_LSAs, lsaCount = " << lsaCount <<
"\n";
1036 lsaCount = lsUpdatePacket->getNetworkLSAsArraySize();
1037 EV_DEBUG <<
"Parsing NETWORK_LSAs, lsaCount = " << lsaCount <<
"\n";
1041 lsaCount = lsUpdatePacket->getInterAreaPrefixLSAsArraySize();
1042 EV_DEBUG <<
"Parsing InterAreaPrefixLSAs, lsaCount = " << lsaCount << endl;
1060 lsaCount = lsUpdatePacket->getLinkLSAsArraySize();
1061 EV_DEBUG <<
"Parsing LINK_LSAs, lsaCount = " << lsaCount <<
"\n";
1065 lsaCount = lsUpdatePacket->getIntraAreaPrefixLSAsArraySize();
1066 EV_DEBUG <<
"Parsing INTRA_AREA_PREFIX_LSAs, lsaCount = " << lsaCount <<
"\n";
1069 throw cRuntimeError(
"Invalid currentType:%d", currentType);
1072 for (
unsigned int i = 0; i < lsaCount; i++) {
1073 const Ospfv3Lsa *currentLSA =
nullptr;
1075 switch (currentType) {
1077 currentLSA = (&(lsUpdatePacket->getRouterLSAs(i)));
1081 EV_DEBUG <<
"Caught NETWORK_LSA in LSU\n";
1082 currentLSA = (&(lsUpdatePacket->getNetworkLSAs(i)));
1086 EV_DEBUG <<
"Caught INTER_AREA_PREFIX_LSA in Update\n";
1087 currentLSA = (&(lsUpdatePacket->getInterAreaPrefixLSAs(i)));
1092 throw cRuntimeError(
"ProcessLSU - managing LSA of type 4 or 5 - not implemented yet! ");
1099 currentLSA = (&(lsUpdatePacket->getLinkLSAs(i)));
1103 EV_DEBUG <<
"Caught INTRA_AREA_PREFIX_LSA in LSU\n";
1104 currentLSA = (&(lsUpdatePacket->getIntraAreaPrefixLSAs(i)));
1108 throw cRuntimeError(
"Invalid currentType:%d", currentType);
1112 lsaKey.linkStateID = currentLSA->getHeader().getLinkStateID();
1113 lsaKey.advertisingRouter = currentLSA->getHeader().getAdvertisingRouter();
1114 lsaKey.LSType = currentLSA->getHeader().getLsaType();
1119 AcknowledgementFlags ackFlags;
1121 uint16_t lsaType = currentLSA->getHeader().getLsaType();
1122 ackFlags.floodedBackOut =
false;
1123 ackFlags.lsaIsNewer =
false;
1124 ackFlags.lsaIsDuplicate =
false;
1125 ackFlags.impliedAcknowledgement =
false;
1126 ackFlags.lsaReachedMaxAge = (lsAge ==
MAX_AGE);
1128 ackFlags.noLSAInstanceInDatabase = (lsaInDatabase ==
nullptr);
1131 if ((ackFlags.lsaReachedMaxAge) && (ackFlags.noLSAInstanceInDatabase) && (!ackFlags.anyNeighborInExchangeOrLoadingState)) {
1138 EV_DEBUG <<
"Sending ACK to all\n";
1142 EV_DEBUG <<
"Sending ACK to Designated mcast\n";
1148 EV_DEBUG <<
"Sending ACK to all\n";
1152 EV_DEBUG <<
"Sending ACK only to neighbor\n";
1161 if (!ackFlags.noLSAInstanceInDatabase) {
1163 ackFlags.lsaIsNewer = (lsaInDatabase->getHeader() < currentLSA->getHeader());
1164 ackFlags.lsaIsDuplicate = (
operator==(lsaInDatabase->getHeader(), currentLSA->getHeader()));
1167 if ((ackFlags.noLSAInstanceInDatabase) || (ackFlags.lsaIsNewer)) {
1168 EV_DEBUG <<
"No lsa instance in database\n";
1170 LSATrackingInfo *info = (!ackFlags.noLSAInstanceInDatabase) ?
dynamic_cast<LSATrackingInfo *
>(lsaInDatabase) :
nullptr;
1172 if ((!ackFlags.noLSAInstanceInDatabase) &&
1181 EV_DEBUG <<
"Flooding the LSA out\n";
1182 if (currentLSA->getHeader().getLsaType() !=
LINK_LSA)
1183 ackFlags.floodedBackOut = this->getArea()->getInstance()->getProcess()->floodLSA(currentLSA, areaID,
this, neighbor);
1192 if (!ackFlags.noLSAInstanceInDatabase) {
1195 lsaKey.linkStateID = lsaInDatabase->getHeader().getLinkStateID();
1196 lsaKey.advertisingRouter = lsaInDatabase->getHeader().getAdvertisingRouter();
1197 lsaKey.LSType = lsaInDatabase->getHeader().getLsaType();
1203 bool installSuccessfull =
false;
1204 EV_DEBUG <<
"Installing the LSA\n";
1211 if ((installSuccessfull ==
false) && (ackFlags.lsaIsNewer ==
false)) {
1212 ackFlags.lsaIsDuplicate =
true;
1214 rebuildRoutingTable |= installSuccessfull;
1216 EV_INFO <<
"(update installed)\n";
1219 this->
acknowledgeLSA(currentLSA->getHeader(), ackFlags, lsUpdatePacket->getRouterID());
1220 if ((currentLSA->getHeader().getAdvertisingRouter() == this->getArea()->getInstance()->getProcess()->getRouterID()) ||
1222 (currentLSA->getHeader().getAdvertisingRouter() == this->getArea()->getInstance()->getProcess()->getRouterID())))
1224 if (ackFlags.noLSAInstanceInDatabase) {
1225 auto lsaCopy = currentLSA->dup();
1226 lsaCopy->getHeaderForUpdate().setLsaAge(
MAX_AGE);
1227 if (lsaCopy->getHeader().getLsaType() !=
LINK_LSA) {
1228 EV_DEBUG <<
"flood LSA in noLSAInstanceInDatabase\n";
1234 lsaKey.linkStateID = currentLSA->getHeader().getLinkStateID();
1235 lsaKey.advertisingRouter = currentLSA->getHeader().getAdvertisingRouter();
1236 lsaKey.LSType = currentLSA->getHeader().getLsaType();
1237 neighbor->removeFromRequestList(lsaKey);
1242 if (ackFlags.lsaIsNewer) {
1243 long sequenceNumber = currentLSA->getHeader().getLsaSequenceNumber();
1245 lsaInDatabase->getHeaderForUpdate().setLsaAge(
MAX_AGE);
1246 EV_DEBUG <<
"flood LSA in lsaIsNewer\n";
1250 lsaInDatabase->getHeaderForUpdate().setLsaSequenceNumber(sequenceNumber + 1);
1258 if (ackFlags.lsaIsDuplicate) {
1259 if (neighbor->isLinkStateRequestListEmpty(lsaKey)) {
1260 neighbor->removeFromRetransmissionList(lsaKey);
1261 ackFlags.impliedAcknowledgement =
true;
1263 acknowledgeLSA(currentLSA->getHeader(), ackFlags, lsUpdatePacket->getRouterID());
1266 if ((lsaInDatabase->getHeader().getLsaAge() ==
MAX_AGE) &&
1277 EV_DEBUG <<
"Neighbor in lesser than EXCHANGE_STATE -> Drop the packet\n";
1280 if (rebuildRoutingTable)
Referenced by inet::ospfv3::Ospfv3Instance::processPacket().
◆ removeFromAllRetransmissionLists()
| void inet::ospfv3::Ospfv3Interface::removeFromAllRetransmissionLists |
( |
LSAKeyType |
lsaKey | ) |
|
1678 for (
long i = 0; i < neighborCount; i++) {
1679 neighbors[i]->removeFromRetransmissionList(lsaKey);
◆ removeNeighborByID()
| void inet::ospfv3::Ospfv3Interface::removeNeighborByID |
( |
Ipv4Address |
neighborID | ) |
|
◆ reset()
| void inet::ospfv3::Ospfv3Interface::reset |
( |
| ) |
|
◆ sendDelayedAcknowledgements()
| void inet::ospfv3::Ospfv3Interface::sendDelayedAcknowledgements |
( |
| ) |
|
◆ sendLSAcknowledgement()
1408 Ospfv3Options options;
1409 const auto& lsAckPacket = makeShared<Ospfv3LinkStateAcknowledgementPacket>();
1412 lsAckPacket->setRouterID(this->
getArea()->getInstance()->getProcess()->getRouterID());
1413 lsAckPacket->setAreaID(this->
getArea()->getAreaID());
1414 lsAckPacket->setInstanceID(this->
getArea()->getInstance()->getInstanceID());
1416 lsAckPacket->setLsaHeadersArraySize(1);
1417 lsAckPacket->setLsaHeaders(0, *lsaHeader);
1423 Packet *pk =
new Packet();
1424 pk->insertAtBack(lsAckPacket);
Referenced by processLSU().
◆ setAckDelay()
| void inet::ospfv3::Ospfv3Interface::setAckDelay |
( |
int |
newAckDelay | ) |
|
|
inline |
◆ setArea()
| void inet::ospfv3::Ospfv3Interface::setArea |
( |
Ospfv3Area * |
area | ) |
|
|
inline |
◆ setBackupID()
| void inet::ospfv3::Ospfv3Interface::setBackupID |
( |
Ipv4Address |
newID | ) |
|
|
inline |
◆ setBackupIP()
| void inet::ospfv3::Ospfv3Interface::setBackupIP |
( |
Ipv6Address |
newIP | ) |
|
|
inline |
◆ setDeadInterval()
| void inet::ospfv3::Ospfv3Interface::setDeadInterval |
( |
int |
newInterval | ) |
|
|
inline |
◆ setDesignatedID()
| void inet::ospfv3::Ospfv3Interface::setDesignatedID |
( |
Ipv4Address |
newID | ) |
|
|
inline |
◆ setDesignatedIntID()
| void inet::ospfv3::Ospfv3Interface::setDesignatedIntID |
( |
int |
newIntID | ) |
|
|
inline |
◆ setDesignatedIP()
| void inet::ospfv3::Ospfv3Interface::setDesignatedIP |
( |
Ipv6Address |
newIP | ) |
|
|
inline |
◆ setHelloInterval()
| void inet::ospfv3::Ospfv3Interface::setHelloInterval |
( |
int |
newInterval | ) |
|
|
inline |
◆ setInterfaceCost()
| void inet::ospfv3::Ospfv3Interface::setInterfaceCost |
( |
int |
newInterval | ) |
|
|
inline |
◆ setInterfaceIndex()
| void inet::ospfv3::Ospfv3Interface::setInterfaceIndex |
( |
int |
newIndex | ) |
|
|
inline |
◆ setInterfaceType()
◆ setRouterPriority()
| void inet::ospfv3::Ospfv3Interface::setRouterPriority |
( |
int |
newPriority | ) |
|
|
inline |
◆ setTransitAreaID()
| void inet::ospfv3::Ospfv3Interface::setTransitAreaID |
( |
Ipv4Address |
areaId | ) |
|
|
inline |
◆ setTransitNetInt()
| void inet::ospfv3::Ospfv3Interface::setTransitNetInt |
( |
bool |
isTransit | ) |
|
|
inline |
◆ str()
| std::string inet::ospfv3::Ospfv3Interface::str |
( |
| ) |
const |
|
override |
1911 std::stringstream out;
1913 out <<
"Interface " << this->
getIntName() <<
" Info:\n";
◆ updateLinkLSA()
| bool inet::ospfv3::Ospfv3Interface::updateLinkLSA |
( |
LinkLSA * |
currentLsa, |
|
|
const Ospfv3LinkLsa * |
newLsa |
|
) |
| |
◆ Ospfv3InterfaceState
◆ ackDelay
| short inet::ospfv3::Ospfv3Interface::ackDelay |
|
private |
◆ acknowledgementTimer
| cMessage* inet::ospfv3::Ospfv3Interface::acknowledgementTimer |
|
private |
◆ BackupRouterID
| Ipv4Address inet::ospfv3::Ospfv3Interface::BackupRouterID |
|
private |
◆ BackupRouterIP
| Ipv6Address inet::ospfv3::Ospfv3Interface::BackupRouterIP |
|
private |
◆ containingArea
| Ospfv3Area* inet::ospfv3::Ospfv3Interface::containingArea |
|
private |
◆ containingModule
| cModule* inet::ospfv3::Ospfv3Interface::containingModule = nullptr |
◆ containingProcess
| Ospfv3Process* inet::ospfv3::Ospfv3Interface::containingProcess = nullptr |
◆ deadInterval
| short inet::ospfv3::Ospfv3Interface::deadInterval |
|
private |
◆ delayedAcknowledgements
◆ DesignatedIntID
| int inet::ospfv3::Ospfv3Interface::DesignatedIntID |
|
private |
◆ DesignatedRouterID
| Ipv4Address inet::ospfv3::Ospfv3Interface::DesignatedRouterID |
|
private |
◆ DesignatedRouterIP
| Ipv6Address inet::ospfv3::Ospfv3Interface::DesignatedRouterIP |
|
private |
◆ helloInterval
| short inet::ospfv3::Ospfv3Interface::helloInterval |
|
private |
◆ helloTimer
| cMessage* inet::ospfv3::Ospfv3Interface::helloTimer |
|
private |
◆ ift
◆ interfaceAddresses
◆ interfaceCost
| int inet::ospfv3::Ospfv3Interface::interfaceCost |
|
private |
◆ interfaceId
| int inet::ospfv3::Ospfv3Interface::interfaceId |
|
private |
◆ interfaceIndex
| int inet::ospfv3::Ospfv3Interface::interfaceIndex |
|
private |
◆ interfaceLLIP
| Ipv6Address inet::ospfv3::Ospfv3Interface::interfaceLLIP |
|
private |
◆ interfaceName
| std::string inet::ospfv3::Ospfv3Interface::interfaceName |
|
private |
◆ interfaceType
◆ linkLSAList
| std::vector<LinkLSA *> inet::ospfv3::Ospfv3Interface::linkLSAList |
|
private |
◆ linkLSAsByID
◆ linkLSASequenceNumber
◆ mtu
| int inet::ospfv3::Ospfv3Interface::mtu |
|
private |
◆ neighbors
| std::vector<Ospfv3Neighbor *> inet::ospfv3::Ospfv3Interface::neighbors |
|
private |
Referenced by addDelayedAcknowledgement(), addNeighbor(), ageTransmittedLSALists(), detailedInfo(), floodLSA(), hasAnyNeighborInState(), isOnAnyRetransmissionList(), prepareHello(), processHelloPacket(), removeFromAllRetransmissionLists(), removeNeighborByID(), and ~Ospfv3Interface().
◆ neighborsById
◆ ospfv3IntStateOutput
| const char* inet::ospfv3::Ospfv3Interface::ospfv3IntStateOutput[7] |
Initial value:= {
"Down",
"Loopback",
"Waiting",
"Point-to-Point",
"DROther",
"Backup",
"DR"
}
Referenced by detailedInfo().
◆ ospfv3IntTypeOutput
| const char* inet::ospfv3::Ospfv3Interface::ospfv3IntTypeOutput[6] |
Initial value:= {
"UNKNOWN",
"POINT-TO-POINT",
"BROADCAST",
"NBMA",
"POINT-TO-MULTIPOINT",
"VIRTUAL"
}
Referenced by detailedInfo().
◆ passiveInterface
| bool inet::ospfv3::Ospfv3Interface::passiveInterface |
|
private |
◆ pollInterval
| short inet::ospfv3::Ospfv3Interface::pollInterval |
|
private |
◆ previousState
◆ retransmissionInterval
| short inet::ospfv3::Ospfv3Interface::retransmissionInterval |
|
private |
◆ routerPriority
| int inet::ospfv3::Ospfv3Interface::routerPriority |
|
private |
◆ state
◆ transitAreaID
| Ipv4Address inet::ospfv3::Ospfv3Interface::transitAreaID |
|
private |
◆ transitNetworkInterface
| bool inet::ospfv3::Ospfv3Interface::transitNetworkInterface |
|
private |
◆ transmissionDelay
| short inet::ospfv3::Ospfv3Interface::transmissionDelay |
|
private |
◆ waitTimer
| cMessage* inet::ospfv3::Ospfv3Interface::waitTimer |
|
private |
The documentation for this class was generated from the following files:
#define VIRTUAL_LINK_TTL
Definition: Ospfv2Common.h:36
#define CHK(x)
Definition: INETDefs.h:87
short getDeadInterval() const
Definition: Ospfv3Interface.h:114
@ TWOWAY_STATE
Definition: Ospfv3Neighbor.h:46
Ospfv3Area * containingArea
Definition: Ospfv3Interface.h:218
@ NEIGHBOR_CHANGE_EVENT
Definition: Ospfv3Interface.h:42
Ospfv3Neighbor * getNeighbor(int i)
Definition: Ospfv3Interface.h:130
int getInterfaceId() const
Definition: Ospfv3Interface.h:120
@ TWOWAY_RECEIVED
Definition: Ospfv3Neighbor.h:25
@ LINKSTATE_ACKNOWLEDGEMENT_PACKET
Definition: OspfPacketBase_m.h:69
uint32_t getInt() const
Returns the address as an uint32_t in host byte order (e.g.
Definition: Ipv4Address.h:186
bool passiveInterface
Definition: Ospfv3Interface.h:206
@ FULL_STATE
Definition: Ospfv3Neighbor.h:50
@ NBMA_TYPE
Definition: Ospfv3Interface.h:54
virtual const Ospfv3LsaHeader & getHeader() const
@ BROADCAST_TYPE
Definition: Ospfv3Interface.h:53
std::vector< Ipv6AddressRange > interfaceAddresses
Definition: Ospfv3Interface.h:222
bool updateLinkLSA(LinkLSA *currentLsa, const Ospfv3LinkLsa *newLsa)
Definition: Ospfv3Interface.cc:1847
@ NSSA
Definition: Ospfv3Area.h:23
#define MAX_SEQUENCE_NUMBER
Definition: Ospfv2Common.h:34
@ INTERFACE_STATE_DROTHER
Definition: Ospfv3Interface.h:31
@ DOWN_STATE
Definition: Ospfv3Neighbor.h:43
@ INTERFACE_STATE_WAITING
Definition: Ospfv3Interface.h:29
Ospfv3InterfaceType getType() const
Definition: Ospfv3Interface.h:129
Ospfv3Process * getProcess() const
Definition: Ospfv3Instance.h:32
const B OSPFV3_LINK_LSA_BODY_LENGTH
Definition: Ospfv3Common.h:74
Ospfv3Process * containingProcess
Definition: Ospfv3Interface.h:89
int getAreaCount()
Definition: Ospfv3Instance.h:43
int count(const std::vector< T > &v, const Tk &a)
Definition: stlutils.h:54
const char * ospfv3IntStateOutput[7]
Definition: Ospfv3Interface.h:59
Ipv6Address getBackupIP() const
Definition: Ospfv3Interface.h:132
@ EXCHANGE_START_STATE
Definition: Ospfv3Neighbor.h:47
@ NEIGHBOR_REVIVED_EVENT
Definition: Ospfv3Interface.h:47
bool preProcessDDPacket(Packet *packet, Ospfv3Neighbor *neighbor, bool inExchangeStart)
Definition: Ospfv3Interface.cc:750
@ SLAVE
Definition: Ospfv3Neighbor.h:55
@ ATTEMPT_STATE
Definition: Ospfv3Neighbor.h:44
@ INTERFACE_STATE_LOOPBACK
Definition: Ospfv3Interface.h:28
Ospfv3Lsa * findLSA(LSAKeyType lsaKey, Ipv4Address areaID, int instanceID)
Definition: Ospfv3Process.cc:744
const char * ospfv3IntTypeOutput[6]
Definition: Ospfv3Interface.h:69
Ipv4Address transitAreaID
Definition: Ospfv3Interface.h:219
LinkLSA * originateLinkLSA()
Definition: Ospfv3Interface.cc:1728
cMessage * acknowledgementTimer
Definition: Ospfv3Interface.h:242
short getTransDelayInterval() const
Definition: Ospfv3Interface.h:116
virtual std::string getInterfaceStateString() const =0
int interfaceId
Definition: Ospfv3Interface.h:201
cMessage * helloTimer
Definition: Ospfv3Interface.h:240
removed DscpReq Ipv4ControlInfo Ipv6ControlInfo up L3AddressInd L3AddressInd
Definition: IUdp-gates.txt:20
@ HELLO_TIMER
Definition: Ospfv3Timers.h:9
Packet * prepareHello()
Definition: Ospfv3Interface.cc:226
Ospfv3InterfaceState * state
Definition: Ospfv3Interface.h:207
std::string getIntName() const
Definition: Ospfv3Interface.h:95
int routerPriority
Definition: Ospfv3Interface.h:215
Packet * prepareUpdatePacket(std::vector< Ospfv3Lsa * > lsas)
Definition: Ospfv3Interface.cc:912
int isInRoutingTable6(Ipv6RoutingTable *rtTable, Ipv6Address addr)
Definition: Ospfv3Process.cc:104
@ ONEWAY_RECEIVED
Definition: Ospfv3Neighbor.h:32
void sendPacket(Packet *packet, Ipv6Address destination, const char *ifName, short hopLimit=1)
Definition: Ospfv3Process.cc:690
short deadInterval
Definition: Ospfv3Interface.h:210
#define MAX_AGE
Definition: Ospfv2Common.h:27
LinkLSA * getLinkLSAbyKey(LSAKeyType lsaKey)
Definition: Ospfv3Interface.cc:1814
@ INTERFACE_PASSIVE
Definition: Ospfv3Interface.h:34
virtual Ospfv3Interface::Ospfv3InterfaceFaState getState() const =0
#define DEFAULT_ROUTER_PRIORITY
Definition: Ospfv3Common.h:19
@ INTRA_AREA_PREFIX_LSA
Definition: Ospfv3Packet_m.h:404
Ipv6Address DesignatedRouterIP
Definition: Ospfv3Interface.h:233
@ NETWORK_LSA
Definition: Ospfv3Packet_m.h:397
void rebuildRoutingTable()
Definition: Ospfv3Process.cc:840
void acknowledgeLSA(const Ospfv3LsaHeader &lsaHeader, AcknowledgementFlags ackFlags, Ipv4Address routerID)
Definition: Ospfv3Interface.cc:1321
Ipv4Address getDesignatedID() const
Definition: Ospfv3Interface.h:133
@ HELLO_PACKET
Definition: OspfPacketBase_m.h:65
int getProcessID() const
Definition: Ospfv3Process.h:39
@ ACKNOWLEDGEMENT_TIMER
Definition: Ospfv3Timers.h:16
@ LINKSTATE_UPDATE_PACKET
Definition: OspfPacketBase_m.h:68
std::map< Ipv4Address, LinkLSA * > linkLSAsByID
Definition: Ospfv3Interface.h:226
Ospfv3Instance * getInstance() const
Definition: Ospfv3Area.h:41
virtual NetworkInterface * getInterfaceById(int id) const =0
Returns an interface by its Id.
@ LINK_LSA
Definition: Ospfv3Packet_m.h:403
#define IPV4INSTANCE
Definition: Ospfv3Common.h:20
virtual void processEvent(Ospfv3Interface *interface, Ospfv3Interface::Ospfv3InterfaceEvent eventNum)=0
@ LOOP_IND_EVENT
Definition: Ospfv3Interface.h:44
std::map< Ipv4Address, Ospfv3Neighbor * > neighborsById
Definition: Ospfv3Interface.h:224
bool isOnAnyRetransmissionList(LSAKeyType lsaKey) const
Definition: Ospfv3Interface.cc:1683
bool installLSA(const Ospfv3Lsa *lsaC, int instanceID, Ipv4Address areaID=Ipv4Address::UNSPECIFIED_ADDRESS, Ospfv3Interface *intf=nullptr)
Definition: Ospfv3Process.cc:779
#define INITIAL_SEQUENCE_NUMBER
Definition: Ospfv2Common.h:33
virtual NetworkInterface * findInterfaceByName(const char *name) const =0
Returns an interface given by its name.
@ SEQUENCE_NUMBER_MISMATCH
Definition: Ospfv3Neighbor.h:31
const Ipv4Address BACKBONE_AREAID(0, 0, 0, 0)
short getRetransmissionInterval() const
Definition: Ospfv3Interface.h:117
void addDelayedAcknowledgement(const Ospfv3LsaHeader &lsaHeader)
Definition: Ospfv3Interface.cc:1429
int getAddressFamily()
Definition: Ospfv3Instance.h:31
cMessage * waitTimer
Definition: Ospfv3Interface.h:241
@ HELLO_TIMER_EVENT
Definition: Ospfv3Interface.h:45
@ INTERFACE_STATE_DOWN
Definition: Ospfv3Interface.h:27
short ackDelay
Definition: Ospfv3Interface.h:214
Ipv4Address getBackupID() const
Definition: Ospfv3Interface.h:134
int getRouterPriority() const
Definition: Ospfv3Interface.h:112
Ipv4Address getRouterID()
Definition: Ospfv3Process.h:40
@ UNLOOP_IND_EVENT
Definition: Ospfv3Interface.h:39
intscale< b, 1, 8 > B
Definition: Units.h:1168
@ INTERFACE_UP_EVENT
Definition: Ospfv3Interface.h:38
@ NEGOTIATION_DONE
Definition: Ospfv3Neighbor.h:26
Ipv4Address BackupRouterID
Definition: Ospfv3Interface.h:236
@ NSSA_LSA
Definition: Ospfv3Packet_m.h:402
@ AS_EXTERNAL_LSA
Definition: Ospfv3Packet_m.h:400
B calculateLSASize(const Ospfv3RouterLsa *routerLSA)
Definition: Ospfv3Lsa.cc:19
@ WAIT_TIMER
Definition: Ospfv3Timers.h:10
static const Ipv6Address UNSPECIFIED_ADDRESS
The unspecified address.
Definition: Ipv6Address.h:54
int getInterfaceCost() const
Definition: Ospfv3Interface.h:119
@ MASTER
Definition: Ospfv3Neighbor.h:54
int DesignatedIntID
Definition: Ospfv3Interface.h:237
int interfaceCost
Definition: Ospfv3Interface.h:238
@ POINTTOMULTIPOINT_TYPE
Definition: Ospfv3Interface.h:55
@ EXCHANGE_DONE
Definition: Ospfv3Neighbor.h:27
Ospfv3NeighborStateType
Definition: Ospfv3Neighbor.h:42
bool floodLSA(const Ospfv3Lsa *lsa, Ospfv3Interface *interface=nullptr, Ospfv3Neighbor *neighbor=nullptr)
Definition: Ospfv3Interface.cc:1520
@ BAD_LINK_STATE_REQUEST
Definition: Ospfv3Neighbor.h:28
void removeFromAllRetransmissionLists(LSAKeyType lsaKey)
Definition: Ospfv3Instance.cc:143
const B OSPFV3_LSA_HEADER_LENGTH
Definition: Ospfv3Common.h:59
bool hasAnyNeighborInState(int state) const
Definition: Ospfv3Interface.cc:109
@ POINTTOPOINT_TYPE
Definition: Ospfv3Interface.h:52
int getNeighborCount() const
Definition: Ospfv3Interface.h:122
short transmissionDelay
Definition: Ospfv3Interface.h:212
std::vector< Ospfv3Neighbor * > neighbors
Definition: Ospfv3Interface.h:223
bool linkLSADiffersFrom(Ospfv3LinkLsa *currentLsa, const Ospfv3LinkLsa *newLsa)
Definition: Ospfv3Interface.cc:1860
std::string str(bool printUnspec=true) const
Returns the string representation of the address (e.g.
Definition: Ipv4Address.cc:98
@ INTER_AREA_PREFIX_LSA
Definition: Ospfv3Packet_m.h:398
void setTimer(cMessage *msg, double delay)
Definition: Ospfv3Process.cc:654
Ospfv3Neighbor * getNeighborById(Ipv4Address neighborId)
Definition: Ospfv3Interface.cc:1694
void removeFromAllRetransmissionLists(LSAKeyType lsaKey)
Definition: Ospfv3Area.cc:943
#define CHECK_AGE
Definition: Ospfv2Common.h:28
@ ACKNOWLEDGEMENT_TIMER_EVENT
Definition: Ospfv3Interface.h:46
Ospfv3Interface::Ospfv3InterfaceFaState getState() const
Definition: Ospfv3Interface.cc:99
int interfaceIndex
Definition: Ospfv3Interface.h:202
@ IS_ADJACENCY_OK
Definition: Ospfv3Neighbor.h:30
const double k
Definition: Qam1024Modulation.cc:14
Ipv6Address BackupRouterIP
Definition: Ospfv3Interface.h:234
Ipv4Address DesignatedRouterID
Definition: Ospfv3Interface.h:235
Ospfv3InterfaceState * previousState
Definition: Ospfv3Interface.h:208
bool floodLSA(const Ospfv3Lsa *lsa, Ipv4Address areaID=Ipv4Address::UNSPECIFIED_ADDRESS, Ospfv3Interface *intf=nullptr, Ospfv3Neighbor *neighbor=nullptr)
Definition: Ospfv3Process.cc:751
@ BACKUP_SEEN_EVENT
Definition: Ospfv3Interface.h:41
@ VIRTUAL_TYPE
Definition: Ospfv3Interface.h:56
Ipv6Address getDesignatedIP() const
Definition: Ospfv3Interface.h:131
void originateInterAreaPrefixLSA(Ospfv3IntraAreaPrefixLsa *lsa, Ospfv3Area *fromArea, bool checkDuplicate)
Definition: Ospfv3Area.cc:1117
ModuleRefByPar< Ipv6RoutingTable > rt6
Definition: Ospfv3Process.h:72
@ INTERFACE_DOWN_EVENT
Definition: Ospfv3Interface.h:43
const B OSPFV3_HEADER_LENGTH
Definition: Ospfv3Common.h:57
static const Ipv4Address UNSPECIFIED_ADDRESS
0.0.0.0
Definition: Ipv4Address.h:91
Ipv6Address interfaceLLIP
Definition: Ospfv3Interface.h:204
int getInstanceID()
Definition: Ospfv3Instance.h:30
const value_type & get() const
Definition: Units.h:108
@ EXCHANGE_STATE
Definition: Ospfv3Neighbor.h:48
IInterfaceTable * ift
Definition: Ospfv3Interface.h:90
void sendLSAcknowledgement(const Ospfv3LsaHeader *lsaHeader, Ipv6Address destination)
Definition: Ospfv3Interface.cc:1406
short retransmissionInterval
Definition: Ospfv3Interface.h:213
@ INTER_AREA_ROUTER_LSA
Definition: Ospfv3Packet_m.h:399
@ INIT_STATE
Definition: Ospfv3Neighbor.h:45
bool operator==(const VertexID &leftID, const VertexID &rightID)
Definition: Ospfv3Common.h:250
std::string interfaceName
Definition: Ospfv3Interface.h:205
@ WAIT_TIMER_EVENT
Definition: Ospfv3Interface.h:40
short pollInterval
Definition: Ospfv3Interface.h:211
@ INTERFACE_STATE_POINTTOPOINT
Definition: Ospfv3Interface.h:30
#define MIN_LS_ARRIVAL
Definition: Ospfv2Common.h:26
void addNeighbor(Ospfv3Neighbor *)
Definition: Ospfv3Interface.cc:1717
Ospfv3Area * getArea() const
Definition: Ospfv3Interface.h:142
void processEvent(Ospfv3Interface::Ospfv3InterfaceEvent)
Definition: Ospfv3Interface.cc:75
bool transitNetworkInterface
Definition: Ospfv3Interface.h:229
value< double, units::m > m
Definition: Units.h:1233
static const Ipv6Address ALL_OSPF_ROUTERS_MCAST
OSPF multicast address for listening.
Definition: Ipv6Address.h:84
int getLinkLSACount()
Definition: Ospfv3Interface.h:177
const Ospfv3LsaHeader * findLSA(LSAKeyType lsaKey)
Definition: Ospfv3Area.cc:140
std::map< Ipv6Address, std::list< Ospfv3LsaHeader > > delayedAcknowledgements
Definition: Ospfv3Interface.h:225
std::vector< LinkLSA * > linkLSAList
Definition: Ospfv3Interface.h:203
#define DEFAULT_HELLO_INTERVAL
Definition: Ospfv3Common.h:13
#define LS_REFRESH_TIME
Definition: Ospfv2Common.h:24
@ ROUTER_LSA
Definition: Ospfv3Packet_m.h:396
void clearTimer(cMessage *msg)
Definition: Ospfv3Process.h:44
uint32_t linkLSASequenceNumber
Definition: Ospfv3Interface.h:231
bool getExternalRoutingCapability()
Definition: Ospfv3Area.h:48
short helloInterval
Definition: Ospfv3Interface.h:209
Ipv4Address getAreaID() const
Definition: Ospfv3Area.h:32
short getHelloInterval() const
Definition: Ospfv3Interface.h:113
#define DEFAULT_DEAD_INTERVAL
Definition: Ospfv3Common.h:14
cModule * containingModule
Definition: Ospfv3Interface.h:88
const Ipv4Address NULL_IPV4ADDRESS(0, 0, 0, 0)
@ DEPRECATED
Definition: Ospfv3Packet_m.h:401
static const Ipv6Address ALL_OSPF_DESIGNATED_ROUTERS_MCAST
OSPF designated routers.
Definition: Ipv6Address.h:87
@ UNKNOWN_TYPE
Definition: Ospfv3Interface.h:51
@ LOADING_STATE
Definition: Ospfv3Neighbor.h:49
@ INTERFACE_STATE_BACKUP
Definition: Ospfv3Interface.h:32
Ospfv3Interface::Ospfv3InterfaceType interfaceType
Definition: Ospfv3Interface.h:220
@ INTERFACE_STATE_DESIGNATED
Definition: Ospfv3Interface.h:33