INET Framework for OMNeT++/OMNEST
inet::ospfv3::Ospfv3Interface Class Reference

#include <Ospfv3Interface.h>

Inheritance diagram for inet::ospfv3::Ospfv3Interface:

Classes

struct  AcknowledgementFlags
 

Public Types

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
}
 

Public Member Functions

 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
 
Ospfv3NeighborgetNeighbor (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 ()
 
Ospfv3AreagetArea () const
 
void setArea (Ospfv3Area *area)
 
Ospfv3InterfaceStategetCurrentState ()
 
Ospfv3InterfaceStategetPreviousState ()
 
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 ()
 
PacketprepareHello ()
 
PacketprepareLSUHeader ()
 
PacketprepareUpdatePacket (std::vector< Ospfv3Lsa * > lsas)
 
Ospfv3NeighborgetNeighborById (Ipv4Address neighborId)
 
void addNeighbor (Ospfv3Neighbor *)
 
std::string str () const override
 
std::string detailedInfo () const
 
void acknowledgeLSA (const Ospfv3LsaHeader &lsaHeader, AcknowledgementFlags ackFlags, Ipv4Address routerID)
 
LinkLSAoriginateLinkLSA ()
 
bool installLinkLSA (const Ospfv3LinkLsa *lsa)
 
void addLinkLSA (LinkLSA *newLSA)
 
int getLinkLSACount ()
 
LinkLSAgetLinkLSA (int i)
 
LinkLSAgetLinkLSAbyKey (LSAKeyType lsaKey)
 
bool updateLinkLSA (LinkLSA *currentLsa, const Ospfv3LinkLsa *newLsa)
 
bool linkLSADiffersFrom (Ospfv3LinkLsa *currentLsa, const Ospfv3LinkLsa *newLsa)
 
LinkLSAfindLinkLSAbyAdvRouter (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 ()
 

Public Attributes

const char * ospfv3IntStateOutput [7]
 
const char * ospfv3IntTypeOutput [6]
 
cModule * containingModule = nullptr
 
Ospfv3ProcesscontainingProcess = nullptr
 
IInterfaceTableift = nullptr
 

Private Attributes

int interfaceId
 
int interfaceIndex
 
std::vector< LinkLSA * > linkLSAList
 
Ipv6Address interfaceLLIP
 
std::string interfaceName
 
bool passiveInterface
 
Ospfv3InterfaceStatestate
 
Ospfv3InterfaceStatepreviousState = nullptr
 
short helloInterval
 
short deadInterval
 
short pollInterval
 
short transmissionDelay
 
short retransmissionInterval
 
short ackDelay
 
int routerPriority
 
int mtu
 
Ospfv3AreacontainingArea
 
Ipv4Address transitAreaID
 
Ospfv3Interface::Ospfv3InterfaceType interfaceType
 
std::vector< Ipv6AddressRangeinterfaceAddresses
 
std::vector< Ospfv3Neighbor * > neighbors
 
std::map< Ipv4Address, Ospfv3Neighbor * > neighborsById
 
std::map< Ipv6Address, std::list< Ospfv3LsaHeader > > delayedAcknowledgements
 
std::map< Ipv4Address, LinkLSA * > linkLSAsByID
 
bool transitNetworkInterface
 
uint32_t linkLSASequenceNumber = INITIAL_SEQUENCE_NUMBER
 
Ipv6Address DesignatedRouterIP
 
Ipv6Address BackupRouterIP
 
Ipv4Address DesignatedRouterID
 
Ipv4Address BackupRouterID
 
int DesignatedIntID
 
int interfaceCost
 
cMessage * helloTimer
 
cMessage * waitTimer
 
cMessage * acknowledgementTimer
 

Friends

class Ospfv3InterfaceState
 

Member Enumeration Documentation

◆ 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 
50  {
51  UNKNOWN_TYPE = 0,
53  BROADCAST_TYPE = 2,
54  NBMA_TYPE = 3,
56  VIRTUAL_TYPE = 5
57  };

Constructor & Destructor Documentation

◆ Ospfv3Interface()

inet::ospfv3::Ospfv3Interface::Ospfv3Interface ( const char *  name,
cModule *  routerModule,
Ospfv3Process processModule,
Ospfv3InterfaceType  interfaceType,
bool  passive 
)
13  :
19  ackDelay(1),
25  DesignatedIntID(-1),
26  interfaceCost(10)
27 {
28  this->interfaceName = std::string(name);
29  this->state = new Ospfv3InterfaceStateDown;
30  this->containingModule = routerModule;
31  this->containingProcess = processModule;
32  this->ift = check_and_cast<IInterfaceTable *>(containingModule->getSubmodule("interfaceTable"));
33 
34  NetworkInterface *ie = CHK(this->ift->findInterfaceByName(this->interfaceName.c_str()));
35  const auto& ipv6int = ie->getProtocolData<Ipv6InterfaceData>();
36  this->interfaceId = ift->getInterfaceById(ie->getInterfaceId())->getInterfaceId();
37  this->interfaceLLIP = ipv6int->getLinkLocalAddress();
39  this->passiveInterface = passive;
40  this->transitNetworkInterface = false; // false at first
41 
42  this->helloTimer = new cMessage("Ospfv3Interface::HelloTimer", HELLO_TIMER);
43  helloTimer->setContextPointer(this);
44 
45  this->waitTimer = new cMessage("Ospfv3Interface::WaitTimer", WAIT_TIMER);
46  waitTimer->setContextPointer(this);
47 
48  this->acknowledgementTimer = new cMessage("Ospfv3Interface::AcknowledgementTimer", ACKNOWLEDGEMENT_TIMER);
49  acknowledgementTimer->setContextPointer(this);
50 } // constructor

◆ ~Ospfv3Interface()

inet::ospfv3::Ospfv3Interface::~Ospfv3Interface ( )
virtual
53 {
57  delete helloTimer;
58  delete waitTimer;
59  delete acknowledgementTimer;
60  if (previousState != nullptr) {
61  delete previousState;
62  }
63  delete state;
64  long neighborCount = neighbors.size();
65  for (long i = 0; i < neighborCount; i++) {
66  delete neighbors[i];
67  }
68  long lsaCount = linkLSAList.size();
69  for (long j = 0; j < lsaCount; j++) {
70  delete linkLSAList[j];
71  }
72  linkLSAList.clear();
73 } // destructor

Member Function Documentation

◆ acknowledgeLSA()

void inet::ospfv3::Ospfv3Interface::acknowledgeLSA ( const Ospfv3LsaHeader lsaHeader,
AcknowledgementFlags  ackFlags,
Ipv4Address  routerID 
)
1324 {
1325  EV_DEBUG << "AcknowledgeLSA\n";
1326  bool sendDirectAcknowledgment = false;
1327 
1328  if (!acknowledgementFlags.floodedBackOut) {
1329  EV_DEBUG << "\tFloodedBackOut is false\n";
1331  if ((acknowledgementFlags.lsaIsNewer && (lsaSource == this->getDesignatedID())) ||
1332  (acknowledgementFlags.lsaIsDuplicate && acknowledgementFlags.impliedAcknowledgement))
1333  {
1334  EV_DEBUG << "Adding delayed acknowledgement\n";
1335  this->addDelayedAcknowledgement(lsaHeader);
1336  }
1337  else {
1338  if ((acknowledgementFlags.lsaIsDuplicate && !acknowledgementFlags.impliedAcknowledgement) ||
1339  (acknowledgementFlags.lsaReachedMaxAge &&
1340  acknowledgementFlags.noLSAInstanceInDatabase &&
1341  acknowledgementFlags.anyNeighborInExchangeOrLoadingState))
1342  {
1343  sendDirectAcknowledgment = true;
1344  }
1345  }
1346  }
1347  else {
1348  if (acknowledgementFlags.lsaIsNewer) {
1349  EV_DEBUG << "Adding delayed acknowledgement\n";
1350  this->addDelayedAcknowledgement(lsaHeader);
1351  }
1352  else {
1353  if ((acknowledgementFlags.lsaIsDuplicate && !acknowledgementFlags.impliedAcknowledgement) ||
1354  (acknowledgementFlags.lsaReachedMaxAge &&
1355  acknowledgementFlags.noLSAInstanceInDatabase &&
1356  acknowledgementFlags.anyNeighborInExchangeOrLoadingState))
1357  {
1358  sendDirectAcknowledgment = true;
1359  }
1360  }
1361  }
1362  }
1363 
1364  if (sendDirectAcknowledgment) {
1365  const auto& ackPacket = makeShared<Ospfv3LinkStateAcknowledgementPacket>();
1366 
1367  ackPacket->setType(ospf::LINKSTATE_ACKNOWLEDGEMENT_PACKET);
1368  ackPacket->setRouterID(this->getArea()->getInstance()->getProcess()->getRouterID());
1369  ackPacket->setAreaID(this->getArea()->getAreaID());
1370  ackPacket->setInstanceID(this->getArea()->getInstance()->getInstanceID());
1371 
1372  ackPacket->setLsaHeadersArraySize(1);
1373  ackPacket->setLsaHeaders(0, lsaHeader);
1374 
1375  ackPacket->setChunkLength(B(OSPFV3_HEADER_LENGTH + OSPFV3_LSA_HEADER_LENGTH));
1376  int hopLimit = (this->getType() == Ospfv3Interface::VIRTUAL_TYPE) ? VIRTUAL_LINK_TTL : 1;
1377 
1378  Packet *pk = new Packet();
1379  pk->insertAtBack(ackPacket);
1380 
1381  if (this->getType() == Ospfv3Interface::BROADCAST_TYPE) {
1385  {
1386  this->getArea()->getInstance()->getProcess()->sendPacket(pk, Ipv6Address::ALL_OSPF_ROUTERS_MCAST, this->getIntName().c_str(), hopLimit);
1387  }
1388  else {
1390  }
1391  }
1392  else {
1394  this->getArea()->getInstance()->getProcess()->sendPacket(pk, Ipv6Address::ALL_OSPF_ROUTERS_MCAST, this->getIntName().c_str(), hopLimit);
1395  }
1396  else {
1397  Ospfv3Neighbor *neighbor = this->getNeighborById(lsaSource);
1398  ASSERT(neighbor);
1399  this->getArea()->getInstance()->getProcess()->sendPacket(pk, neighbor->getNeighborIP(), this->getIntName().c_str(), hopLimit);
1400  }
1401  }
1402  }
1403 } // acknowledgeLSA

Referenced by processLSU().

◆ addDelayedAcknowledgement()

void inet::ospfv3::Ospfv3Interface::addDelayedAcknowledgement ( const Ospfv3LsaHeader lsaHeader)
1430 {
1431  EV_DEBUG << "calling add delayded ack\n";
1436  {
1438  }
1439  else {
1441  }
1442  }
1443  else {
1444  long neighborCount = this->neighbors.size();
1445  for (long i = 0; i < neighborCount; i++) {
1446  if (this->neighbors.at(i)->getState() >= Ospfv3Neighbor::EXCHANGE_STATE) {
1447  delayedAcknowledgements[this->neighbors.at(i)->getNeighborIP()].push_back(lsaHeader);
1448  }
1449  }
1450  }
1451 
1452  if (!this->acknowledgementTimer->isScheduled())
1453  this->getArea()->getInstance()->getProcess()->setTimer(this->acknowledgementTimer, 1);
1454 } // addDelayedAcknowledgement

Referenced by acknowledgeLSA().

◆ addInterfaceAddress()

void inet::ospfv3::Ospfv3Interface::addInterfaceAddress ( Ipv6AddressRange  address)
inline
191 { this->interfaceAddresses.push_back(address); }

◆ addLinkLSA()

void inet::ospfv3::Ospfv3Interface::addLinkLSA ( LinkLSA newLSA)
inline
176 { this->linkLSAList.push_back(newLSA); }

◆ addNeighbor()

void inet::ospfv3::Ospfv3Interface::addNeighbor ( Ospfv3Neighbor newNeighbor)
1718 {
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) {
1723  this->neighbors.push_back(newNeighbor);
1724  this->neighborsById[newNeighbor->getNeighborID()] = newNeighbor;
1725  }
1726 } // addNeighbor

Referenced by processHelloPacket().

◆ ageDatabase()

bool inet::ospfv3::Ospfv3Interface::ageDatabase ( )
129 {
130  long lsaCount = this->getLinkLSACount();
131  bool shouldRebuildRoutingTable = false;
132  long i;
133 
134  for (i = 0; i < lsaCount; i++) {
135  LinkLSA *lsa = linkLSAList[i];
136  unsigned short lsAge = lsa->getHeader().getLsaAge();
137  bool selfOriginated = (lsa->getHeader().getAdvertisingRouter() == this->getArea()->getInstance()->getProcess()->getRouterID());
138 // TODO unreachability is not managed, Should be on places where it is as a comment
139 // bool unreachable = parentRouter->isDestinationUnreachable(lsa);
140 
141  if ((selfOriginated && (lsAge < (LS_REFRESH_TIME - 1))) || (!selfOriginated && (lsAge < (MAX_AGE - 1)))) {
142  lsa->getHeaderForUpdate().setLsaAge(lsAge + 1);
143  if ((lsAge + 1) % CHECK_AGE == 0) {
144  if (!lsa->validateLSChecksum()) { // always return true
145  EV_ERROR << "Invalid LS checksum. Memory error detected!\n";
146  }
147  }
148  lsa->incrementInstallTime();
149  }
150  if (selfOriginated && (lsAge == (LS_REFRESH_TIME - 1))) {
151 // if (unreachable) {
152 // lsa->getHeader().setLsAge(MAX_AGE);
153 // floodLSA(lsa);
154 // lsa->incrementInstallTime();
155 // }
156 // else
157 
158  long sequenceNumber = lsa->getHeader().getLsaSequenceNumber();
159  if (sequenceNumber == MAX_SEQUENCE_NUMBER) {
160  lsa->getHeaderForUpdate().setLsaAge(MAX_AGE);
161  floodLSA(lsa);
162  lsa->incrementInstallTime();
163  }
164  else {
165  LinkLSA *newLSA = originateLinkLSA();
166  newLSA->getHeaderForUpdate().setLsaSequenceNumber(sequenceNumber + 1);
167  shouldRebuildRoutingTable |= updateLinkLSA(lsa, newLSA);
168  delete newLSA;
169 
170  floodLSA(lsa);
171  }
172  }
173  if (!selfOriginated && (lsAge == MAX_AGE - 1)) {
174  lsa->getHeaderForUpdate().setLsaAge(MAX_AGE);
175  floodLSA(lsa);
176  lsa->incrementInstallTime();
177  }
178  if (lsAge == MAX_AGE) {
179  LSAKeyType lsaKey;
180 
181  lsaKey.linkStateID = lsa->getHeader().getLinkStateID();
182  lsaKey.advertisingRouter = lsa->getHeader().getAdvertisingRouter();
183 
184  if (!isOnAnyRetransmissionList(lsaKey) &&
185  (
188  {
189  if (!selfOriginated /*|| unreachable*/) {
190  linkLSAsByID.erase(lsa->getHeader().getLinkStateID());
191  delete lsa;
192  linkLSAList[i] = nullptr;
193  shouldRebuildRoutingTable = true;
194  }
195  else {
196  LinkLSA *newLSA = originateLinkLSA();
197  long sequenceNumber = lsa->getHeader().getLsaSequenceNumber();
198 
199  if (newLSA != nullptr) {
200  newLSA->getHeaderForUpdate().setLsaSequenceNumber((sequenceNumber == MAX_SEQUENCE_NUMBER) ? INITIAL_SEQUENCE_NUMBER : sequenceNumber + 1);
201  shouldRebuildRoutingTable |= updateLinkLSA(lsa, newLSA);
202  delete newLSA;
203 
204  floodLSA(lsa);
205  }
206  else
207  delete linkLSAList[i];
208  }
209  }
210  }
211  }
212 
213  auto linkIt = linkLSAList.begin();
214  while (linkIt != linkLSAList.end()) {
215  if ((*linkIt) == nullptr) {
216  linkIt = linkLSAList.erase(linkIt);
217  }
218  else {
219  linkIt++;
220  }
221  }
222  return shouldRebuildRoutingTable;
223 }

◆ ageTransmittedLSALists()

void inet::ospfv3::Ospfv3Interface::ageTransmittedLSALists ( )
121 {
122  long neighborCount = neighbors.size();
123  for (long i = 0; i < neighborCount; i++) {
124  neighbors[i]->ageTransmittedLSAList();
125  }
126 }

◆ calculateInterfaceCost()

int inet::ospfv3::Ospfv3Interface::calculateInterfaceCost ( )

◆ changeState()

void inet::ospfv3::Ospfv3Interface::changeState ( Ospfv3InterfaceState currentState,
Ospfv3InterfaceState newState 
)
88 {
89  EV_DEBUG << "Interface state is changing from " << currentState->getInterfaceStateString() << " to " << newState->getInterfaceStateString() << "\n";
90 
91  if (this->previousState != nullptr)
92  delete this->previousState; // FIXME - create destructor
93 
94  this->previousState = currentState;
95  this->state = newState;
96  EV_DEBUG << "Changing state of interface \n";
97 } // changeState

Referenced by inet::ospfv3::Ospfv3InterfaceState::changeState().

◆ detailedInfo()

std::string inet::ospfv3::Ospfv3Interface::detailedInfo ( ) const
1918 {
1919  std::stringstream out;
1920  Ipv4Address neighbor;
1921  Ipv6Address designatedIP;
1922  Ipv6Address backupIP;
1923 
1924  int adjCount = 0;
1925  for (auto it = this->neighbors.begin(); it != this->neighbors.end(); it++) {
1926  if ((*it)->getState() == Ospfv3Neighbor::FULL_STATE)
1927  adjCount++;
1928 
1929  if ((*it)->getNeighborID() == this->DesignatedRouterID)
1930  designatedIP = (*it)->getNeighborIP();
1931  if ((*it)->getNeighborID() == this->BackupRouterID)
1932  backupIP = (*it)->getNeighborIP();
1933  }
1934 
1935  out << "Interface " << this->getIntName() << "\n";
1936  out << "Link Local Address ";
1937  NetworkInterface *ie = CHK(this->ift->findInterfaceByName(this->getIntName().c_str()));
1938  const auto& ipv6int = ie->getProtocolData<Ipv6InterfaceData>();
1939  out << ipv6int->getLinkLocalAddress() << ", Interface ID " << this->interfaceId << "\n";
1940 
1941  if (this->getArea()->getInstance()->getAddressFamily() == IPV4INSTANCE) {
1942  const auto& ipv4int = ie->getProtocolData<Ipv4InterfaceData>();
1943  out << "Internet Address " << ipv4int->getIPAddress() << endl;
1944  }
1945 
1946  out << "Area " << this->getArea()->getAreaID().getInt();
1947  out << ", Process ID " << this->getArea()->getInstance()->getProcess()->getProcessID();
1948  out << ", Instance ID " << this->getArea()->getInstance()->getInstanceID() << ", ";
1949  out << "Router ID " << this->getArea()->getInstance()->getProcess()->getRouterID() << endl;
1950 
1951  out << "Network Type " << this->ospfv3IntTypeOutput[this->getType()];
1952  out << ", Cost: " << this->getInterfaceCost() << endl;
1953 
1954  out << "Transmit Delay is " << this->getTransDelayInterval() << " sec, ";
1955  out << "State " << this->ospfv3IntStateOutput[this->getState()];
1956  out << ", Priority " << this->getRouterPriority() << endl;
1957 
1958  out << "Designated Router (ID) " << this->getDesignatedID().str(false);
1959  out << ", local address " << this->getDesignatedIP() << endl;
1960 
1961  out << "Backup Designated router (ID) " << this->getBackupID().str(false);
1962  out << ", local address " << this->getBackupIP() << endl;
1963 
1964  out << "Timer intervals configured, Hello " << this->getHelloInterval();
1965  out << ", Dead " << this->getDeadInterval();
1966  out << ", Wait " << this->getDeadInterval();
1967  out << ", Retransmit " << this->getRetransmissionInterval() << endl;
1968 
1969  out << "\tHello due in " << (int)simTime().dbl() % this->helloInterval << endl;
1970 
1971  out << "Neighbor Count is " << this->getNeighborCount();
1972  out << ", Adjacent neighbor count is " << adjCount << endl;
1973 
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";
1979  else if ((*it)->getState() == Ospfv3Neighbor::FULL_STATE)
1980  out << "Adjacent with neighbor " << (*it)->getNeighborID() << endl;
1981  }
1982 
1983  out << "Suppress Hello for 0 neighbor(s)\n";
1984 
1985  return out.str();
1986 } // detailedInfo

Referenced by inet::ospfv3::operator<<().

◆ findLinkLSAbyAdvRouter()

LinkLSA * inet::ospfv3::Ospfv3Interface::findLinkLSAbyAdvRouter ( Ipv4Address  advRouter)
1900 {
1901  for (auto it = this->linkLSAList.begin(); it != this->linkLSAList.end(); it++) {
1902  if ((*it)->getHeader().getAdvertisingRouter() == advRouter)
1903  return *it;
1904  }
1905 
1906  return nullptr;
1907 }

◆ floodLSA()

bool inet::ospfv3::Ospfv3Interface::floodLSA ( const Ospfv3Lsa lsa,
Ospfv3Interface interface = nullptr,
Ospfv3Neighbor neighbor = nullptr 
)
1521 {
1522 // std::cout << this->getArea()->getInstance()->getProcess()->getRouterID() << " - FLOOD LSA INTERFACE!!" << endl;
1523  bool floodedBackOut = false;
1524 
1525  if (
1526  (
1527  (lsa->getHeader().getLsaType() == AS_EXTERNAL_LSA) &&
1529  (this->getArea()->getExternalRoutingCapability())
1530  ) ||
1531  (
1532  // if it is BACKBONE AREA
1533  (lsa->getHeader().getLsaType() != AS_EXTERNAL_LSA) &&
1534  (
1535  (
1536  (this->getArea()->getAreaID() != Ipv4Address::UNSPECIFIED_ADDRESS) &&
1538  ) ||
1539  (this->getArea()->getAreaID() == Ipv4Address::UNSPECIFIED_ADDRESS)
1540  )
1541  )
1542  )
1543  {
1544  // Checking if this is backbone
1545  long neighborCount = this->getNeighborCount();
1546  bool lsaAddedToRetransmissionList = false;
1547  Ipv4Address linkStateID = lsa->getHeader().getLinkStateID();
1548  LSAKeyType lsaKey;
1549 
1550  lsaKey.linkStateID = linkStateID;
1551  lsaKey.advertisingRouter = lsa->getHeader().getAdvertisingRouter();
1552  lsaKey.LSType = lsa->getHeader().getLsaType();
1553 
1554  for (long i = 0; i < neighborCount; i++) { // (1)
1555  // neighbor is not in STATE for LSA flooding
1556  if (this->neighbors.at(i)->getState() < Ospfv3Neighbor::EXCHANGE_STATE) { // (1) (a)
1557 // EV_DEBUG << "Skipping neighbor " << this->neighbors.at(i)->getNeighborID() << "\n";
1558  continue;
1559  }
1560  if (this->neighbors.at(i)->getState() < Ospfv3Neighbor::FULL_STATE) { // (1) (b)
1561 // EV_DEBUG << "Adjacency not yet full\n";
1562  Ospfv3LsaHeader *requestLSAHeader = this->neighbors.at(i)->findOnRequestList(lsaKey);
1563  if (requestLSAHeader != nullptr) {
1564 // EV_DEBUG << "Instance of new lsa already on the list\n";
1565  // operator< and operator== on OSPFLSAHeaders determines which one is newer(less means older)
1566  if (lsa->getHeader() < (*requestLSAHeader)) {
1567 // EV_DEBUG << "Instance is less recent\n";
1568  continue;
1569  }
1570  if (operator==(lsa->getHeader(), (*requestLSAHeader))) {
1571 // EV_DEBUG << "Two instances are the same, removing from request list\n";
1572  this->neighbors.at(i)->removeFromRequestList(lsaKey);
1573  continue;
1574  }
1575  this->neighbors.at(i)->removeFromRequestList(lsaKey);
1576  }
1577  }
1578  if (neighbor == this->neighbors.at(i)) { // (1) (c)
1579 // EV_DEBUG << "1c - next neighbor\n";
1580  continue;
1581  }
1582 
1583  this->neighbors.at(i)->addToRetransmissionList(lsa); // (1) (d)
1584  lsaAddedToRetransmissionList = true;
1585  }
1586  if (lsaAddedToRetransmissionList) { // (2)
1587  EV_DEBUG << "lsaAddedToRetransmissionList true\n";
1588  if ((interface != this) ||
1589  ((neighbor != nullptr) &&
1590  (neighbor->getNeighborID() != this->getDesignatedID()) &&
1591  (neighbor->getNeighborID() != this->getBackupID()))) // (3)
1592  {
1593  EV_DEBUG << "step 3 passed\n";
1594  if ((interface != this) || (getState() != Ospfv3Interface::INTERFACE_STATE_BACKUP)) { // (4)
1595  EV_DEBUG << "step 4 passed\n";
1596 // Packet* updatePacket = this->prepareLSUHeader(); // (5)
1597  std::vector<Ospfv3Lsa *> lsas;
1598  Ospfv3Lsa *lsaCopy = lsa->dup();
1599  lsas.push_back(lsaCopy);
1600  Packet *updatePacket = this->prepareUpdatePacket(lsas);
1601  delete lsaCopy;
1602 
1603  if (updatePacket != nullptr) {
1604  EV_DEBUG << "Prepared LSUpdate packet is ready\n";
1606 
1611  {
1612  EV_DEBUG << "Sending LSUpdate packet\n";
1613  this->getArea()->getInstance()->getProcess()->sendPacket(updatePacket, Ipv6Address::ALL_OSPF_ROUTERS_MCAST, this->getIntName().c_str(), hopLimit);
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();
1619  }
1620  }
1621  }
1622  else {
1623  EV_DEBUG << "Sending packet from floodLSA\n";
1624  this->getArea()->getInstance()->getProcess()->sendPacket(updatePacket, Ipv6Address::ALL_OSPF_DESIGNATED_ROUTERS_MCAST, this->getIntName().c_str(), hopLimit);
1625  Ospfv3Neighbor *dRouter = this->getNeighborById(this->DesignatedRouterID);
1626  Ospfv3Neighbor *backupDRouter = this->getNeighborById(this->BackupRouterID);
1627  if (dRouter != nullptr) {
1628  dRouter->addToTransmittedLSAList(lsaKey);
1629  if (!dRouter->isUpdateRetransmissionTimerActive()) {
1630  dRouter->startUpdateRetransmissionTimer();
1631  }
1632  }
1633  if (dRouter != backupDRouter && backupDRouter != nullptr) {
1634  backupDRouter->addToTransmittedLSAList(lsaKey);
1635  if (!backupDRouter->isUpdateRetransmissionTimerActive()) {
1636  backupDRouter->startUpdateRetransmissionTimer();
1637  }
1638  }
1639  }
1640  }
1641  else {
1643  this->getArea()->getInstance()->getProcess()->sendPacket(updatePacket, Ipv6Address::ALL_OSPF_ROUTERS_MCAST, this->getIntName().c_str(), hopLimit);
1644  if (neighborCount > 0) {
1645  this->neighbors.at(0)->addToTransmittedLSAList(lsaKey);
1646  if (!this->neighbors.at(0)->isUpdateRetransmissionTimerActive()) {
1647  this->neighbors.at(0)->startUpdateRetransmissionTimer();
1648  }
1649  }
1650  }
1651  else {
1652  for (long m = 0; m < neighborCount; m++) {
1653  if (this->neighbors.at(m)->getState() >= Ospfv3Neighbor::EXCHANGE_STATE) {
1654  this->getArea()->getInstance()->getProcess()->sendPacket(updatePacket, this->neighbors.at(m)->getNeighborIP(), this->getIntName().c_str(), hopLimit);
1655  this->neighbors.at(m)->addToTransmittedLSAList(lsaKey);
1656  if (!this->neighbors.at(m)->isUpdateRetransmissionTimerActive()) {
1657  this->neighbors.at(m)->startUpdateRetransmissionTimer();
1658  }
1659  }
1660  }
1661  }
1662  }
1663  if (interface == this) {
1664  floodedBackOut = true;
1665  }
1666  }
1667  }
1668  }
1669  }
1670  }
1671 
1672  return floodedBackOut;
1673 } // floodLSA

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
142 { return this->containingArea; };

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()

◆ getBackupIP()

Ipv6Address inet::ospfv3::Ospfv3Interface::getBackupIP ( ) const
inline

◆ getCurrentState()

Ospfv3InterfaceState* inet::ospfv3::Ospfv3Interface::getCurrentState ( )
inline
145 { return this->state; };

◆ getDeadInterval()

◆ getDesignatedID()

◆ getDesignatedIntID()

int inet::ospfv3::Ospfv3Interface::getDesignatedIntID ( ) const
inline
135 { return this->DesignatedIntID; }

Referenced by inet::ospfv3::Ospfv3Area::originateRouterLSA().

◆ getDesignatedIP()

Ipv6Address inet::ospfv3::Ospfv3Interface::getDesignatedIP ( ) const
inline

◆ getHelloInterval()

◆ getHelloTimer()

◆ getInterfaceAddress()

Ipv6AddressRange inet::ospfv3::Ospfv3Interface::getInterfaceAddress ( int  i)
inline
193 { return this->interfaceAddresses[i]; }

◆ getInterfaceAddressCount()

int inet::ospfv3::Ospfv3Interface::getInterfaceAddressCount ( )
inline
192 { return this->interfaceAddresses.size(); }

◆ getInterfaceCost()

int inet::ospfv3::Ospfv3Interface::getInterfaceCost ( ) const
inline
119 { return this->interfaceCost; }

Referenced by detailedInfo().

◆ getInterfaceId()

◆ getInterfaceIndex() [1/2]

int inet::ospfv3::Ospfv3Interface::getInterfaceIndex ( )
inline
124 { return this->interfaceIndex; }

◆ getInterfaceIndex() [2/2]

int inet::ospfv3::Ospfv3Interface::getInterfaceIndex ( ) const
inline
121 { return this->interfaceIndex; }

◆ getInterfaceLLIP()

Ipv6Address inet::ospfv3::Ospfv3Interface::getInterfaceLLIP ( ) const
inline

◆ getInterfaceMTU()

int inet::ospfv3::Ospfv3Interface::getInterfaceMTU ( ) const
82 {
83  NetworkInterface *ie = CHK(this->ift->findInterfaceByName(this->interfaceName.c_str()));
84  return ie->getMtu();
85 }

◆ getIntName()

◆ getLinkLSA()

LinkLSA* inet::ospfv3::Ospfv3Interface::getLinkLSA ( int  i)
inline
178 { return this->linkLSAList.at(i); }

◆ getLinkLSAbyKey()

LinkLSA * inet::ospfv3::Ospfv3Interface::getLinkLSAbyKey ( LSAKeyType  lsaKey)
1815 {
1816  for (auto it = this->linkLSAList.begin(); it != this->linkLSAList.end(); it++) {
1817  if (((*it)->getHeader().getAdvertisingRouter() == lsaKey.advertisingRouter) && (*it)->getHeader().getLinkStateID() == lsaKey.linkStateID) {
1818  return *it;
1819  }
1820  }
1821 
1822  return nullptr;
1823 }

Referenced by installLinkLSA().

◆ getLinkLSACount()

int inet::ospfv3::Ospfv3Interface::getLinkLSACount ( )
inline
177 { return this->linkLSAList.size(); }

Referenced by ageDatabase(), and inet::ospfv3::Ospfv3Neighbor::createDatabaseSummary().

◆ getNeighbor()

◆ getNeighborById()

Ospfv3Neighbor * inet::ospfv3::Ospfv3Interface::getNeighborById ( Ipv4Address  neighborId)
1695 {
1696  auto neighborIt = this->neighborsById.find(neighborId);
1697  return (neighborIt == this->neighborsById.end()) ? nullptr : neighborIt->second;
1698 }

Referenced by acknowledgeLSA(), addNeighbor(), inet::ospfv3::Ospfv3InterfaceState::calculateDesignatedRouter(), floodLSA(), inet::ospfv3::Ospfv3Area::originateRouterLSA(), processDDPacket(), processHelloPacket(), and inet::ospfv3::Ospfv3Instance::processPacket().

◆ getNeighborCount()

◆ getPollInterval()

◆ getPreviousState()

Ospfv3InterfaceState* inet::ospfv3::Ospfv3Interface::getPreviousState ( )
inline
146 { return this->previousState; };

◆ getRetransmissionInterval()

◆ getRouterPriority()

◆ getState()

◆ getTransDelayInterval()

short inet::ospfv3::Ospfv3Interface::getTransDelayInterval ( ) const
inline
116 { return this->transmissionDelay; }

Referenced by detailedInfo().

◆ getTransitAreaID()

Ipv4Address inet::ospfv3::Ospfv3Interface::getTransitAreaID ( ) const
inline
127 { return this->transitAreaID; }

Referenced by inet::ospfv3::Ospfv3Instance::processPacket().

◆ getTransitNetInt()

bool inet::ospfv3::Ospfv3Interface::getTransitNetInt ( )
inline
189 { return this->transitNetworkInterface; }

◆ getType()

◆ getWaitTimer()

cMessage* inet::ospfv3::Ospfv3Interface::getWaitTimer ( )
inline

◆ hasAnyNeighborInState()

bool inet::ospfv3::Ospfv3Interface::hasAnyNeighborInState ( int  state) const
110 {
111  long neighborCount = neighbors.size();
112  for (long i = 0; i < neighborCount; i++) {
113  Ospfv3Neighbor::Ospfv3NeighborStateType neighborState = neighbors[i]->getState();
114  if (neighborState == state)
115  return true;
116  }
117  return false;
118 }

Referenced by inet::ospfv3::Ospfv3Area::ageDatabase(), ageDatabase(), inet::ospfv3::Ospfv3Area::originateNetworkLSA(), and inet::ospfv3::Ospfv3Area::originateRouterLSA().

◆ installLinkLSA()

bool inet::ospfv3::Ospfv3Interface::installLinkLSA ( const Ospfv3LinkLsa lsa)
1826 {
1827 // auto lsa = lsaC->dup(); // make editable copy of lsa
1828 // EV_DEBUG << "Link LSA is being installed in database \n";
1829  LSAKeyType lsaKey;
1830  lsaKey.linkStateID = lsa->getHeader().getLinkStateID();
1831  lsaKey.advertisingRouter = lsa->getHeader().getAdvertisingRouter();
1832  lsaKey.LSType = lsa->getHeader().getLsaType();
1833 
1834  LinkLSA *lsaInDatabase = this->getLinkLSAbyKey(lsaKey);
1835  if (lsaInDatabase != nullptr) {
1836 // EV_DEBUG << "Link LSA is being removed from retransmission lists\n";
1837  this->getArea()->removeFromAllRetransmissionLists(lsaKey);
1838  return this->updateLinkLSA(lsaInDatabase, lsa);
1839  }
1840  else {
1841  LinkLSA *lsaCopy = new LinkLSA(*lsa);
1842  this->linkLSAList.push_back(lsaCopy);
1843  return true;
1844  }
1845 } // installLinkLSA

Referenced by inet::ospfv3::Ospfv3Process::installLSA(), and inet::ospfv3::Ospfv3InterfaceStateDown::processEvent().

◆ isInterfacePassive()

bool inet::ospfv3::Ospfv3Interface::isInterfacePassive ( )
inline

◆ isOnAnyRetransmissionList()

bool inet::ospfv3::Ospfv3Interface::isOnAnyRetransmissionList ( LSAKeyType  lsaKey) const
1684 {
1685  long neighborCount = getNeighborCount();
1686  for (long i = 0; i < neighborCount; i++) {
1687  if (neighbors[i]->isLinkStateRequestListEmpty(lsaKey)) {
1688  return true;
1689  }
1690  }
1691  return false;
1692 }

Referenced by ageDatabase().

◆ linkLSADiffersFrom()

bool inet::ospfv3::Ospfv3Interface::linkLSADiffersFrom ( Ospfv3LinkLsa currentLsa,
const Ospfv3LinkLsa newLsa 
)
1861 {
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;
1868 
1869  if (!differentHeader) {
1870  differentBody = ((currentLsa->getRouterPriority() != newLsa->getRouterPriority()) ||
1871  (currentLsa->getOspfOptions() != newLsa->getOspfOptions()) ||
1872  (currentLsa->getLinkLocalInterfaceAdd() != newLsa->getLinkLocalInterfaceAdd()) ||
1873  (currentLsa->getPrefixesArraySize() != newLsa->getPrefixesArraySize()));
1874 
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));
1887 
1888  if (differentLink) {
1889  differentBody = true;
1890  break;
1891  }
1892  }
1893  }
1894  }
1895 
1896  return differentHeader || differentBody;
1897 }

Referenced by updateLinkLSA().

◆ originateLinkLSA()

LinkLSA * inet::ospfv3::Ospfv3Interface::originateLinkLSA ( )
1729 {
1730  LinkLSA *linkLSA = new LinkLSA();
1731  Ospfv3LsaHeader& lsaHeader = linkLSA->getHeaderForUpdate();
1732 
1733  // First the LSA Header
1734  lsaHeader.setLsaAge(0);
1735  lsaHeader.setLsaType(LINK_LSA);
1736 
1737  lsaHeader.setLinkStateID(Ipv4Address(this->getInterfaceId()));
1738  lsaHeader.setAdvertisingRouter(this->getArea()->getInstance()->getProcess()->getRouterID());
1739  lsaHeader.setLsaSequenceNumber(this->linkLSASequenceNumber++);
1740 // lsaHeader.setLsaChecksum(); TODO Checksum for LinkLSA is not calculated.
1741 // OSPFV3_LSA_HEADER_LENGTH.get();
1742  uint16_t packetLength = (OSPFV3_LSA_HEADER_LENGTH.get() + OSPFV3_LINK_LSA_BODY_LENGTH.get());
1743 
1744  // Then the LSA Body
1745  linkLSA->setRouterPriority(this->getRouterPriority());
1746  // TODO - LSA Options for LinkLSA is not set.
1747  Ospfv3Options lsOptions;
1748  linkLSA->setOspfOptions(lsOptions);
1749 
1750  NetworkInterface *ie = CHK(this->ift->findInterfaceByName(this->interfaceName.c_str()));
1751  if (this->getArea()->getInstance()->getAddressFamily() == IPV4INSTANCE) {
1752  const auto& ipv4Data = ie->getProtocolData<Ipv4InterfaceData>();
1753  Ipv4Address ipAdd = ipv4Data->getIPAddress();
1754 
1755  // set also ipv4 link local address
1756  linkLSA->setLinkLocalInterfaceAdd(ipAdd);
1757 
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));
1766 
1767  linkLSA->setPrefixesArraySize(1);
1768  linkLSA->setPrefixes(0, prefix);
1769  packetLength += 4;
1770  linkLSA->setNumPrefixes(1);
1771  }
1772  else {
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);
1779  // this also includes linkLocal and Multicast adresses. So there need to be chceck, if writing ipv6 is global
1780  if (ipv6.isGlobal()) { // Only all the global prefixes belong to the Intra-Area-Prefix LSA
1781  Ospfv3LsaPrefix0 prefix;
1782  prefix.dnBit = false;
1783  prefix.laBit = false;
1784  prefix.nuBit = false;
1785  prefix.pBit = false;
1786  prefix.xBit = false;
1787 
1788  int rIndex = this->getArea()->getInstance()->getProcess()->isInRoutingTable6(this->getArea()->getInstance()->getProcess()->rt6, ipv6);
1789  if (rIndex >= 0)
1790  prefix.prefixLen = this->getArea()->getInstance()->getProcess()->rt6->getRoute(rIndex)->getPrefixLength();
1791  else
1792  prefix.prefixLen = 64;
1793 
1794  prefix.addressPrefix = ipv6.getPrefix(prefix.prefixLen);
1795 
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);
1800  }
1801  }
1802  }
1803 
1804  lsaHeader.setLsaLength(packetLength);
1805 
1806  return linkLSA;
1807 }

Referenced by ageDatabase(), and inet::ospfv3::Ospfv3InterfaceStateDown::processEvent().

◆ prepareHello()

Packet * inet::ospfv3::Ospfv3Interface::prepareHello ( )

TODO - Options for Hello Packet is not set.

227 {
228  Ospfv3Options options;
229  int length;
230 // Ospfv3HelloPacket* helloPacket = new Ospfv3HelloPacket();
231  const auto& helloPacket = makeShared<Ospfv3HelloPacket>();
232  std::vector<Ipv4Address> neighbors;
233 
234  // OSPF common packet header first
235  helloPacket->setVersion(3);
236  helloPacket->setType(ospf::HELLO_PACKET);
237  helloPacket->setRouterID(this->getArea()->getInstance()->getProcess()->getRouterID());
238  helloPacket->setAreaID(this->containingArea->getAreaID());
239  helloPacket->setInstanceID(this->getArea()->getInstance()->getInstanceID());
240  length = 16;
241 
242  // Hello content
243  helloPacket->setInterfaceID(this->interfaceId);
244  helloPacket->setRouterPriority(this->getRouterPriority());
245 
246  options.rBit = true;
247  options.v6Bit = true;
248  if (this->getArea()->getExternalRoutingCapability())
249  options.eBit = true;
250 
251  if (this->getArea()->getAreaType() == NSSA)
252  options.nBit = true;
253 
254  helloPacket->setOptions(options);
255  length += 8;
257  helloPacket->setHelloInterval(this->getHelloInterval());
258  helloPacket->setDeadInterval(this->getDeadInterval());
259  helloPacket->setDesignatedRouterID(this->getDesignatedID());
260  helloPacket->setBackupDesignatedRouterID(this->BackupRouterID);
261 
262  length += 12;
263 
264  int neighborCount = this->getNeighborCount();
265  for (int i = 0; i < neighborCount; i++) {
266  if (this->getNeighbor(i)->getState() >= Ospfv3Neighbor::INIT_STATE) {
267  neighbors.push_back(this->getNeighbor(i)->getNeighborID());
268  length += 4;
269  }
270  }
271 
272  unsigned int initedNeighborCount = neighbors.size();
273  helloPacket->setNeighborIDArraySize(initedNeighborCount);
274  for (unsigned int k = 0; k < initedNeighborCount; k++) {
275  helloPacket->setNeighborID(k, neighbors.at(k));
276  }
277 
278  helloPacket->setPacketLengthField(length);
279 
280  helloPacket->setChunkLength(B(length));
281 
282  Packet *pk = new Packet();
283  pk->insertAtBack(helloPacket);
284 
285  return pk;
286 }

Referenced by inet::ospfv3::Ospfv3NeighborStateDown::processEvent(), inet::ospfv3::Ospfv3InterfaceStateDrOther::processEvent(), inet::ospfv3::Ospfv3InterfaceStateDr::processEvent(), inet::ospfv3::Ospfv3InterfaceStateWaiting::processEvent(), inet::ospfv3::Ospfv3InterfaceStatePointToPoint::processEvent(), inet::ospfv3::Ospfv3InterfaceStateBackup::processEvent(), and processHelloPacket().

◆ prepareLSUHeader()

Packet * inet::ospfv3::Ospfv3Interface::prepareLSUHeader ( )
894 {
895  EV_DEBUG << "Preparing LSU HEADER\n";
896  const auto& updatePacket = makeShared<Ospfv3LinkStateUpdatePacket>();
897 
898  updatePacket->setType(ospf::LINKSTATE_UPDATE_PACKET);
899  updatePacket->setRouterID(this->getArea()->getInstance()->getProcess()->getRouterID());
900  updatePacket->setAreaID(this->getArea()->getAreaID());
901  updatePacket->setInstanceID(this->getArea()->getInstance()->getInstanceID());
902 
903  updatePacket->setPacketLengthField(OSPFV3_HEADER_LENGTH.get() + 4); // +4 to include the LSAcount
904  updatePacket->setChunkLength(OSPFV3_HEADER_LENGTH + (B)4);
905  updatePacket->setLsaCount(0);
906 
907  Packet *pk = new Packet();
908  pk->insertAtBack(updatePacket);
909  return pk;
910 }

◆ prepareUpdatePacket()

Packet * inet::ospfv3::Ospfv3Interface::prepareUpdatePacket ( std::vector< Ospfv3Lsa * >  lsas)
913 {
914  EV_DEBUG << "Preparing LSU\n";
915  const auto& updatePacket = makeShared<Ospfv3LinkStateUpdatePacket>();
916 
917  updatePacket->setType(ospf::LINKSTATE_UPDATE_PACKET);
918  updatePacket->setRouterID(this->getArea()->getInstance()->getProcess()->getRouterID());
919  updatePacket->setAreaID(this->getArea()->getAreaID());
920  updatePacket->setInstanceID(this->getArea()->getInstance()->getInstanceID());
921 
922 // updatePacket->setPacketLength(OSPFV3_HEADER_LENGTH+4); //+4 to include the LSAcount
923 // updatePacket->setChunkLength(B(OSPFV3_HEADER_LENGTH+4));
924 
925  updatePacket->setLsaCount(0);
926 
927  for (size_t j = 0; j < lsas.size(); j++) {
928  Ospfv3Lsa *lsa = lsas[j];
929 
930  int count = updatePacket->getLsaCount();
931 // B packetLength = updatePacket->getPacketLength();
932  B packetLength = OSPFV3_HEADER_LENGTH + B(sizeof(uint32_t));
933 
934 // Ospfv3LsaHeader header = lsa->getHeader();
935  uint16_t code = lsa->getHeader().getLsaType();
936 
937  switch (code) {
938  case ROUTER_LSA: {
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);
944  packetLength += calculateLSASize(routerLSA);
945  updatePacket->setPacketLengthField(packetLength.get());
946  updatePacket->setChunkLength(packetLength);
947  break;
948  }
949  case NETWORK_LSA: {
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);
955  packetLength += calculateLSASize(networkLSA);
956  updatePacket->setPacketLengthField(packetLength.get());
957  updatePacket->setChunkLength(B(packetLength));
958  break;
959  }
960 
961  case INTER_AREA_PREFIX_LSA: {
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);
967  packetLength += calculateLSASize(prefixLSA);
968  updatePacket->setPacketLengthField(packetLength.get());
969  updatePacket->setChunkLength(packetLength);
970  break;
971  }
972 
974  break;
975 
976  case AS_EXTERNAL_LSA:
977  break;
978 
979  case DEPRECATED:
980  break;
981 
982  case NSSA_LSA:
983  break;
984 
985  case LINK_LSA: {
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);
991  packetLength += calculateLSASize(linkLSA);
992  updatePacket->setPacketLengthField(packetLength.get());
993  updatePacket->setChunkLength(packetLength);
994  break;
995  }
996 
997  case INTRA_AREA_PREFIX_LSA: {
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);
1003  packetLength += calculateLSASize(prefixLSA);
1004  updatePacket->setPacketLengthField(packetLength.get());
1005  updatePacket->setChunkLength(packetLength);
1006  break;
1007  }
1008  }
1009  }
1010  Packet *pk = new Packet();
1011  pk->insertAtBack(updatePacket);
1012  return pk;
1013 
1014 } // prepareUpdatePacekt

Referenced by floodLSA(), and processLSR().

◆ preProcessDDPacket()

bool inet::ospfv3::Ospfv3Interface::preProcessDDPacket ( Packet packet,
Ospfv3Neighbor neighbor,
bool  inExchangeStart 
)
751 {
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" : "__")
757  << "; seqNumber="
758  << ddPacket->getSequenceNumber()
759  << "):\n";
760 
761  unsigned int headerCount = ddPacket->getLsaHeadersArraySize();
762 
763  for (unsigned int i = 0; i < headerCount; i++) {
764  const Ospfv3LsaHeader& currentHeader = ddPacket->getLsaHeaders(i);
765  uint16_t lsaType = currentHeader.getLsaType();
766  if (((lsaType != ROUTER_LSA) && (lsaType != AS_EXTERNAL_LSA) && (lsaType != LINK_LSA) &&
767  (lsaType != NETWORK_LSA) && (lsaType != INTER_AREA_PREFIX_LSA) && (lsaType != INTER_AREA_ROUTER_LSA) &&
768  (lsaType != NSSA_LSA) && (lsaType != INTRA_AREA_PREFIX_LSA)) ||
769  ((lsaType == AS_EXTERNAL_LSA) && (!this->getArea()->getExternalRoutingCapability())))
770  {
771  EV_ERROR << " Error! LSA TYPE: " << lsaType << "\n";
772  neighbor->processEvent(Ospfv3Neighbor::SEQUENCE_NUMBER_MISMATCH);
773  return false;
774  }
775  else {
776  EV_DEBUG << "Trying to locate LSA in database\n";
777  LSAKeyType lsaKey;
778 
779  lsaKey.linkStateID = currentHeader.getLinkStateID();
780  lsaKey.advertisingRouter = currentHeader.getAdvertisingRouter();
781  lsaKey.LSType = currentHeader.getLsaType();
782 
783  const Ospfv3LsaHeader *lsaInDatabase = this->getArea()->findLSA(lsaKey);
784 
785  // operator< and operator== on OSPFLSAHeaders determines which one is newer(less means older)
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(&currentHeader);
790  }
791  }
792  EV_DETAIL << "\n";
793  }
794 
795  EV_DEBUG << "DatabaseSummaryListCount = " << neighbor->getDatabaseSummaryListCount() << endl;
796  EV_DEBUG << "M_BIT " << ddPacket->getDdOptions().mBit << endl;
797  if (neighbor->getDatabaseExchangeRelationship() == Ospfv3Neighbor::MASTER) {
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";
802  neighbor->processEvent(Ospfv3Neighbor::EXCHANGE_DONE); // does nothing in ExchangeStart
803  }
804  else {
805  if (!inExchangeStart) {
806  EV_DEBUG << "Sending packet\n";
807  neighbor->sendDDPacket();
808  }
809  }
810  }
811  else {
812  neighbor->setDDSequenceNumber(ddPacket->getSequenceNumber());
813  if (!inExchangeStart) {
814  neighbor->sendDDPacket();
815  }
816  if (!ddPacket->getDdOptions().mBit &&
817  (neighbor->getDatabaseSummaryListCount() == 0))
818  {
819  neighbor->processEvent(Ospfv3Neighbor::EXCHANGE_DONE); // does nothing in ExchangeStart
820  }
821  }
822  return true;
823 } // preProcessDDPacket

Referenced by processDDPacket().

◆ processDDPacket()

void inet::ospfv3::Ospfv3Interface::processDDPacket ( Packet packet)
555 {
556 // Ospfv3DatabaseDescription* ddPacket = check_and_cast<Ospfv3DatabaseDescription* >(packet);
557  const auto& ddPacket = packet->peekAtFront<Ospfv3DatabaseDescriptionPacket>();
558  EV_DEBUG << "Process " << this->getArea()->getInstance()->getProcess()->getProcessID() << " received a DD Packet from neighbor " << ddPacket->getRouterID() << " on interface " << this->interfaceName << "\n";
559 
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";
563  Ospfv3Neighbor::Ospfv3NeighborStateType neighborState = neighbor->getState();
564 
565  if ((ddPacket->getInterfaceMTU() <= this->getInterfaceMTU()) &&
566  (neighborState > Ospfv3Neighbor::ATTEMPT_STATE))
567  {
568  switch (neighborState) {
570  EV_DEBUG << "Parsing DD Packet - two way state - throwing away\n";
571  delete packet;
572  // ignoring packet
573  }
574  break;
575 
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();
582 
583  neighbor->processEvent(Ospfv3Neighbor::TWOWAY_RECEIVED);
584  neighbor->setLastReceivedDDPacket(packetID);
585  delete packet;
586  }
587  break;
588 
590  EV_DEBUG << "Router " << this->getArea()->getInstance()->getProcess()->getRouterID() << " is processing DD packet in EXCHANGE_START STATE\n";
591  const Ospfv3DdOptions& ddOptions = ddPacket->getDdOptions();
592 
593  if (ddOptions.iBit && ddOptions.mBit && ddOptions.msBit &&
594  (ddPacket->getLsaHeadersArraySize() == 0))
595  {
596  if (neighbor->getNeighborID() > this->getArea()->getInstance()->getProcess()->getRouterID()) {
597  EV_DEBUG << "Router " << this->getArea()->getInstance()->getProcess()->getRouterID() << " is becoming the slave\n";
598 
599  Ospfv3DdPacketId packetID;
600  packetID.ddOptions = ddPacket->getDdOptions();
601  packetID.options = ddPacket->getOptions();
602  packetID.sequenceNumber = ddPacket->getSequenceNumber();
603 
604  neighbor->setDatabaseExchangeRelationship(Ospfv3Neighbor::SLAVE);
605  neighbor->setLastReceivedDDPacket(packetID);
606 
607  if (!preProcessDDPacket(packet, neighbor, true)) {
608  break;
609  }
610 
611  neighbor->processEvent(Ospfv3Neighbor::NEGOTIATION_DONE);
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())
616  {
617  neighbor->sendLinkStateRequestPacket();
618  neighbor->clearRequestRetransmissionTimer();
619  neighbor->startRequestRetransmissionTimer();
620  }
621  }
622  else {
623  neighbor->sendDDPacket(true);
624  }
625  }
626 
627  if (!ddOptions.iBit && !ddOptions.msBit &&
628  (ddPacket->getSequenceNumber() == neighbor->getDDSequenceNumber()) &&
629  (neighbor->getNeighborID() < this->getArea()->getInstance()->getProcess()->getRouterID()))
630  {
631  Ospfv3DdPacketId packetID;
632  packetID.ddOptions = ddPacket->getDdOptions();
633  packetID.options = ddPacket->getOptions();
634  packetID.sequenceNumber = ddPacket->getSequenceNumber();
635 
636  neighbor->setDatabaseExchangeRelationship(Ospfv3Neighbor::MASTER);
637  neighbor->setLastReceivedDDPacket(packetID);
638 
639  if (!preProcessDDPacket(packet, neighbor, true)) {
640  break;
641  }
642 
643  neighbor->processEvent(Ospfv3Neighbor::NEGOTIATION_DONE);
644  if (!neighbor->isLinkStateRequestListEmpty() &&
645  !neighbor->isRequestRetransmissionTimerActive())
646  {
647  neighbor->sendLinkStateRequestPacket();
648  neighbor->clearRequestRetransmissionTimer();
649  neighbor->startRequestRetransmissionTimer();
650  }
651  }
652  delete packet;
653  }
654  break;
655 
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();
662 
663  if (packetID != neighbor->getLastReceivedDDPacket()) {
664  if ((packetID.ddOptions.msBit &&
665  (neighbor->getDatabaseExchangeRelationship() != Ospfv3Neighbor::SLAVE)) ||
666  (!packetID.ddOptions.msBit &&
667  (neighbor->getDatabaseExchangeRelationship() != Ospfv3Neighbor::MASTER)) ||
668  packetID.ddOptions.iBit ||
669  (packetID.options != neighbor->getLastReceivedDDPacket().options))
670  {
671  EV_DEBUG << "Last DD Sequence is : " << neighbor->getLastReceivedDDPacket().sequenceNumber << "\n";
672  neighbor->processEvent(Ospfv3Neighbor::SEQUENCE_NUMBER_MISMATCH);
673  }
674  else {
675  if (((neighbor->getDatabaseExchangeRelationship() == Ospfv3Neighbor::MASTER) &&
676  (packetID.sequenceNumber == neighbor->getDDSequenceNumber())) ||
677  ((neighbor->getDatabaseExchangeRelationship() == Ospfv3Neighbor::SLAVE) &&
678  (packetID.sequenceNumber == (neighbor->getDDSequenceNumber() + 1))))
679  {
680 
681  neighbor->setLastReceivedDDPacket(packetID);
682  if (!preProcessDDPacket(packet, neighbor, false)) {
683  EV_DEBUG << "Parsing DD Packet - EXCHANGE - preprocessing was true \n";
684  break;
685  }
686  if (!neighbor->isLinkStateRequestListEmpty() &&
687  !neighbor->isRequestRetransmissionTimerActive())
688  {
689  EV_DEBUG << "Parsing DD Packet - sending LINKSTATEREQUEST\n";
690  neighbor->sendLinkStateRequestPacket();
691  neighbor->clearRequestRetransmissionTimer();
692  neighbor->startRequestRetransmissionTimer();
693  }
694  }
695  else {
696  neighbor->processEvent(Ospfv3Neighbor::SEQUENCE_NUMBER_MISMATCH);
697  }
698  }
699  }
700  else {
701  EV_DEBUG << "Received DD was the same as the last one\n";
702  if (neighbor->getDatabaseExchangeRelationship() == Ospfv3Neighbor::SLAVE) {
703  EV_DEBUG << "But I am a slave so I retransmit it\n";
704  neighbor->retransmitDatabaseDescriptionPacket();
705  }
706  }
707  delete packet;
708  }
709  break;
710 
713  Ospfv3DdPacketId packetID;
714  packetID.ddOptions = ddPacket->getDdOptions();
715  packetID.options = ddPacket->getOptions();
716  packetID.sequenceNumber = ddPacket->getSequenceNumber();
717 
718  if ((packetID != neighbor->getLastReceivedDDPacket()) ||
719  (packetID.ddOptions.iBit))
720  {
721  EV_DEBUG << " Processing packet contents(ddOptions="
722  << ((ddPacket->getDdOptions().iBit) ? "I " : "_ ")
723  << ((ddPacket->getDdOptions().mBit) ? "M " : "_ ")
724  << ((ddPacket->getDdOptions().msBit) ? "MS" : "__")
725  << "; seqNumber="
726  << ddPacket->getSequenceNumber()
727  << "):\n";
728 
729  neighbor->processEvent(Ospfv3Neighbor::SEQUENCE_NUMBER_MISMATCH);
730  }
731  else {
732  if (neighbor->getDatabaseExchangeRelationship() == Ospfv3Neighbor::SLAVE) {
733  if (!neighbor->retransmitDatabaseDescriptionPacket()) {
734  neighbor->processEvent(Ospfv3Neighbor::SEQUENCE_NUMBER_MISMATCH);
735  }
736  }
737  }
738  delete packet;
739  }
740  break;
741 
742  default:
743  break;
744  }
745  }
746  else
747  delete packet; // simply reject the packet otherwise
748 }

Referenced by inet::ospfv3::Ospfv3Instance::processPacket().

◆ processEvent()

void inet::ospfv3::Ospfv3Interface::processEvent ( Ospfv3Interface::Ospfv3InterfaceEvent  event)
76 {
77  EV_DEBUG << "Passing event number " << event << " to state" << this->state->getInterfaceStateString() << "\n";
78  this->state->processEvent(this, event);
79 }

Referenced by inet::ospfv3::Ospfv3Process::handleTimer(), and processHelloPacket().

◆ processHelloPacket()

void inet::ospfv3::Ospfv3Interface::processHelloPacket ( Packet packet)
289 {
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;
294  (void)backupSeen; // FIXME set but not used variable
295  bool neighborsDRStateChanged = false;
296  bool drChanged = false;
297  bool shouldRebuildRoutingTable = false;
298  // comparing hello and dead values
299  if ((hello->getHelloInterval() == this->getHelloInterval()) && (hello->getDeadInterval() == this->getDeadInterval())) {
300  if (true) { // this will check the E-bit
301  Ipv4Address sourceId = hello->getRouterID();
302  Ospfv3Neighbor *neighbor = this->getNeighborById(sourceId);
303 
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;
312 
313  if ((this->interfaceType == Ospfv3InterfaceType::VIRTUAL_TYPE) &&
314  (neighbor->getState() == Ospfv3Neighbor::DOWN_STATE))
315  {
316  neighbor->setNeighborPriority(hello->getRouterPriority());
317  neighbor->setNeighborDeadInterval(hello->getDeadInterval());
318  }
319 
320  /* If a change in the neighbor's Router Priority field
321  was noted, the receiving interface's state machine is
322  scheduled with the event NEIGHBOR_CHANGE.
323  */
324  if (neighbor->getNeighborPriority() != newPriority) {
325  neighborChanged = true;
326  }
327 
328  /* If the neighbor is both declaring itself to be Designated
329  Router(Hello Packet's Designated Router field = Neighbor IP
330  address) and the Backup Designated Router field in the
331  packet is equal to 0.0.0.0 and the receiving interface is in
332  state Waiting, the receiving interface's state machine is
333  scheduled with the event BACKUP_SEEN.
334  */
335  if ((newDesignatedRouterID == sourceId) &&
336  (newBackupRouterID == NULL_IPV4ADDRESS) &&
337  (this->getState() == Ospfv3InterfaceFaState::INTERFACE_STATE_WAITING))
338  {
339  backupSeen = true;
340  }
341  else {
342  /* Otherwise, if the neighbor is declaring itself to be Designated Router and it
343  had not previously, or the neighbor is not declaring itself
344  Designated Router where it had previously, the receiving
345  interface's state machine is scheduled with the event
346  NEIGHBOR_CHANGE.
347  */
348  if (((newDesignatedRouterID == sourceId) &&
349  (newDesignatedRouterID != designatedRouterID)) ||
350  ((newDesignatedRouterID != sourceId) &&
351  (sourceId == designatedRouterID)))
352  {
353  neighborChanged = true;
354  neighborsDRStateChanged = true;
355  }
356  }
357  /*Waiting
358  In this state, the router is trying to determine the
359  identity of the (Backup) Designated Router for the network.
360  To do this, the router monitors the Hello Packets it
361  receives. The router is not allowed to elect a Backup
362  Designated Router nor a Designated Router until it
363  transitions out of Waiting state. This prevents unnecessary
364  changes of (Backup) Designated Router.
365  * */
366 
367  /* If the neighbor is declaring itself to be Backup Designated
368  Router(Hello Packet's Backup Designated Router field =
369  Neighbor ID ) and the receiving interface is in state
370  Waiting, the receiving interface's state machine is
371  scheduled with the event BACKUP_SEEN.
372  */
373  if ((newBackupRouterID == sourceId) &&
374  (this->getState() == Ospfv3InterfaceFaState::INTERFACE_STATE_WAITING))
375  {
376  backupSeen = true;
377  }
378  else {
379  /* Otherwise, if the neighbor is declaring itself to be Backup Designated Router
380  and it had not previously, or the neighbor is not declaring
381  itself Backup Designated Router where it had previously, the
382  receiving interface's state machine is scheduled with the
383  event NEIGHBOR_CHANGE.
384  */
385  if (((newBackupRouterID == sourceId) &&
386  (newBackupRouterID != backupRouterID)) ||
387  ((newBackupRouterID != sourceId) &&
388  (sourceId == backupRouterID)))
389  {
390  neighborChanged = true;
391  }
392  }
393 
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;
401  drChanged = true;
402  }
403 
404  neighbor->setDesignatedRouterID(dRouterID);
405  dRouterID = newBackupRouterID;
406  if (newBackupRouterID != backupRouterID) {
407  backupRouterID = dRouterID;
408  drChanged = true;
409  }
410 
411  neighbor->setBackupDesignatedRouterID(dRouterID);
412  if (drChanged) {
413  neighbor->setupDesignatedRouters(false);
414  }
415 
416  /* If the neighbor router's Designated or Backup Designated Router
417  has changed it's necessary to look up the Router IDs belonging to the
418  new addresses.
419  */
420  if (!neighbor->designatedRoutersAreSetUp()) {
421  Ospfv3Neighbor *designated = this->getNeighborById(designatedRouterID);
422  Ospfv3Neighbor *backup = this->getNeighborById(backupRouterID);
423 
424  if (designated != nullptr) {
425  dRouterID = designated->getNeighborID();
426  neighbor->setDesignatedRouterID(dRouterID);
427  }
428  if (backup != nullptr) {
429  dRouterID = backup->getNeighborID();
430  neighbor->setBackupDesignatedRouterID(dRouterID);
431  }
432  if ((designated != nullptr) && (backup != nullptr)) {
433  neighbor->setupDesignatedRouters(true);
434  }
435  }
436 
437  neighbor->setLastHelloTime((int)simTime().dbl());
438  }
439  else {
440  Ipv4Address dRouterID;
441  bool designatedSetUp = false;
442  bool backupSetUp = false;
443 
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());
449 
450  dRouterID = hello->getDesignatedRouterID();
451  Ospfv3Neighbor *designated = this->getNeighborById(dRouterID);
452 
453  // Get the Designated Router ID from the corresponding Neighbor Object.
454  if (designated != nullptr) {
455  if (designated->getNeighborID() != dRouterID) {
456  dRouterID = designated->getNeighborID();
457  }
458  designatedSetUp = true;
459  }
460  neighbor->setDesignatedRouterID(dRouterID);
461 
462  dRouterID = hello->getBackupDesignatedRouterID();
463  Ospfv3Neighbor *backup = this->getNeighborById(dRouterID);
464 
465  // Get the Backup Designated Router ID from the corresponding Neighbor Object.
466  if (backup != nullptr) {
467  if (backup->getNeighborID() != dRouterID) {
468  dRouterID = backup->getNeighborID();
469  }
470  backupSetUp = true;
471  }
472  neighbor->setBackupDesignatedRouterID(dRouterID);
473  if (designatedSetUp && backupSetUp) {
474  neighbor->setupDesignatedRouters(true);
475  }
476 
477  // if iface is DR and this is first neighbor, then it must be revived adjacency
478  if ((this->getState() == Ospfv3InterfaceFaState::INTERFACE_STATE_DESIGNATED ||
479  this->getState() == Ospfv3InterfaceFaState::INTERFACE_STATE_BACKUP)
480  && (this->getNeighborCount() == 0))
481  {
483  }
484 
485  this->addNeighbor(neighbor);
486  }
487 
488  neighbor->processEvent(Ospfv3Neighbor::Ospfv3NeighborEventType::HELLO_RECEIVED);
489  if ((this->interfaceType == Ospfv3InterfaceType::NBMA_TYPE) &&
490  (this->getRouterPriority() == 0) &&
491  (neighbor->getState() >= Ospfv3Neighbor::Ospfv3NeighborStateType::INIT_STATE))
492  {
493  Packet *hello = this->prepareHello();
494  this->getArea()->getInstance()->getProcess()->sendPacket(hello, neighbor->getNeighborIP(), this->interfaceName.c_str());
495  }
496 
497  unsigned int neighborsNeighborCount = hello->getNeighborIDArraySize();
498  unsigned int i;
499 
500  for (i = 0; i < neighborsNeighborCount; i++) {
501  if (hello->getNeighborID(i) == this->getArea()->getInstance()->getProcess()->getRouterID()) {
502  neighbor->processEvent(Ospfv3Neighbor::TWOWAY_RECEIVED);
503  break;
504  }
505  }
506 
507  /* Otherwise, the neighbor state machine should
508  be executed with the event ONEWAY_RECEIVED, and the processing
509  of the packet stops.
510  */
511  if (i == neighborsNeighborCount) {
512  neighbor->processEvent(Ospfv3Neighbor::ONEWAY_RECEIVED);
513  }
514 
515  if (neighborChanged) {
516  EV_DEBUG << "Neighbor change noted in Hello packet\n";
517  this->processEvent(Ospfv3InterfaceEvent::NEIGHBOR_CHANGE_EVENT);
518  /* In some cases neighbors get stuck in TwoWay state after a DR
519  or Backup change. (calculateDesignatedRouter runs before the
520  neighbors' signal of DR change + this router does not become
521  neither DR nor backup -> IS_ADJACENCY_OK does not get called.)
522  So to make it work(workaround) we'll call IS_ADJACENCY_OK for
523  all neighbors in TwoWay state from here. This shouldn't break
524  anything because if the neighbor state doesn't have to change
525  then needAdjacency returns false and nothing happnes in
526  IS_ADJACENCY_OK.
527  */
528  unsigned int neighborCount = this->getNeighborCount();
529  for (i = 0; i < neighborCount; i++) {
530  Ospfv3Neighbor *stuckNeighbor = this->neighbors.at(i);
531  if (stuckNeighbor->getState() == Ospfv3Neighbor::TWOWAY_STATE) {
532  stuckNeighbor->processEvent(Ospfv3Neighbor::IS_ADJACENCY_OK);
533  }
534  }
535 
536  if (neighborsDRStateChanged) {
537  EV_DEBUG << "Router DR has changed - need to add LSAs\n";
538  shouldRebuildRoutingTable = true;
539  }
540  }
541  }
542  }
543 
544  if (shouldRebuildRoutingTable) {
546  }
547 
548  delete packet;
549 } // processHello

Referenced by inet::ospfv3::Ospfv3Instance::processPacket().

◆ processLSAck()

void inet::ospfv3::Ospfv3Interface::processLSAck ( Packet packet,
Ospfv3Neighbor neighbor 
)
1287 {
1288 
1289  if (neighbor->getState() >= Ospfv3Neighbor::EXCHANGE_STATE) {
1290  const auto& lsAckPacket = packet->peekAtFront<Ospfv3LinkStateAcknowledgementPacket>();
1291 
1292  int lsaCount = lsAckPacket->getLsaHeadersArraySize();
1293 
1294  EV_DETAIL << " Link State Acknowledgement Processing packet contents:\n";
1295 
1296  for (int i = 0; i < lsaCount; i++) {
1297  const Ospfv3LsaHeader& lsaHeader = lsAckPacket->getLsaHeaders(i);
1298  Ospfv3Lsa *lsaOnRetransmissionList;
1299  LSAKeyType lsaKey;
1300  lsaKey.linkStateID = lsaHeader.getLinkStateID();
1301  lsaKey.advertisingRouter = lsaHeader.getAdvertisingRouter();
1302 
1303  if ((lsaOnRetransmissionList = neighbor->findOnRetransmissionList(lsaKey)) != nullptr) {
1304  if (operator==(lsaHeader, lsaOnRetransmissionList->getHeader())) {
1305  EV_DEBUG << "neighbor->removeFromRetransmissionList(lsaKey)\n";
1306  neighbor->removeFromRetransmissionList(lsaKey);
1307  }
1308  else {
1309  EV_INFO << "Got an Acknowledgement packet for an unsent Update packet.\n";
1310  }
1311  }
1312  }
1313  if (neighbor->isRetransmissionListEmpty()) {
1314  EV_DEBUG << "neighbor clear Update Retransmission Timer\n";
1315  neighbor->clearUpdateRetransmissionTimer();
1316  }
1317  }
1318  delete packet;
1319 } // processLSAck

Referenced by inet::ospfv3::Ospfv3Instance::processPacket().

◆ processLSR()

void inet::ospfv3::Ospfv3Interface::processLSR ( Packet packet,
Ospfv3Neighbor neighbor 
)
828 {
829  const auto& lsr = packet->peekAtFront<Ospfv3LinkStateRequestPacket>();
830  EV_DEBUG << "Processing LSR Packet from " << lsr->getRouterID() << "\n";
831  bool error = false;
832  std::vector<Ospfv3Lsa *> lsas;
833 
834  // parse the packet only if the neighbor is in EXCHANGE, LOADING or FULL state
835  if (neighbor->getState() == Ospfv3Neighbor::EXCHANGE_STATE || neighbor->getState() == Ospfv3Neighbor::LOADING_STATE
836  || neighbor->getState() == Ospfv3Neighbor::FULL_STATE)
837  {
838  // getting lsa headers from request
839  for (unsigned int i = 0; i < lsr->getRequestsArraySize(); i++) {
840  const Ospfv3LsRequest& request = lsr->getRequests(i);
841  LSAKeyType lsaKey;
842 
843  lsaKey.LSType = request.lsaType;
844  lsaKey.linkStateID = request.lsaID;
845  lsaKey.advertisingRouter = request.advertisingRouter;
846 
847  Ospfv3Lsa *lsaInDatabase = this->getArea()->getInstance()->getProcess()->findLSA(lsaKey, this->getArea()->getAreaID(), this->getArea()->getInstance()->getInstanceID());
848 
849  if (lsaInDatabase != nullptr) {
850  lsas.push_back(lsaInDatabase);
851  }
852  else {
853  error = true;
854  EV_DEBUG << "Somehow I got here...BAD_LINK_STATE_REQUEST\n ";
855  neighbor->processEvent(Ospfv3Neighbor::BAD_LINK_STATE_REQUEST);
856  break;
857  }
858  }
859 
860  if (!error) {
861  int hopLimit = (this->getType() == Ospfv3Interface::VIRTUAL_TYPE) ? VIRTUAL_LINK_TTL : 1;
862 
863  Packet *updatePacket = this->prepareUpdatePacket(lsas);
864  if (updatePacket != nullptr) {
865  if (this->getType() == Ospfv3Interface::BROADCAST_TYPE) {
867  // I don't think that this is ok(this->getState() == Ospfv3Interface::INTERFACE_STATE_BACKUP) ||
869  {
870  this->getArea()->getInstance()->getProcess()->sendPacket(updatePacket, Ipv6Address::ALL_OSPF_ROUTERS_MCAST, this->getIntName().c_str(), hopLimit);
871  }
872  else {
873  this->getArea()->getInstance()->getProcess()->sendPacket(updatePacket, Ipv6Address::ALL_OSPF_DESIGNATED_ROUTERS_MCAST, this->getIntName().c_str(), hopLimit);
874  }
875  }
876  else {
878  this->getArea()->getInstance()->getProcess()->sendPacket(updatePacket, Ipv6Address::ALL_OSPF_ROUTERS_MCAST, this->getIntName().c_str(), hopLimit);
879  }
880  else {
881  this->getArea()->getInstance()->getProcess()->sendPacket(updatePacket, neighbor->getNeighborIP(), this->getIntName().c_str(), hopLimit);
882  }
883  }
884  }
885  }
886  }
887 // else//otherwise just ignore it
888 // delete(packet);
889  delete packet;
890 }

Referenced by inet::ospfv3::Ospfv3Instance::processPacket().

◆ processLSU()

void inet::ospfv3::Ospfv3Interface::processLSU ( Packet packet,
Ospfv3Neighbor neighbor 
)
1017 {
1018  const auto& lsUpdatePacket = packet->peekAtFront<Ospfv3LinkStateUpdatePacket>();
1019  bool rebuildRoutingTable = false;
1020 
1021  if (neighbor->getState() >= Ospfv3Neighbor::EXCHANGE_STATE) {
1022  EV_DEBUG << "Processing LSU from " << lsUpdatePacket->getRouterID() << "\n";
1023  int currentType = ROUTER_LSA;
1024  Ipv4Address areaID = lsUpdatePacket->getAreaID();
1025 
1026  // First I get count from one array
1027  while (currentType >= ROUTER_LSA && currentType <= INTRA_AREA_PREFIX_LSA) {
1028  unsigned int lsaCount = 0;
1029  switch (currentType) {
1030  case ROUTER_LSA:
1031  lsaCount = lsUpdatePacket->getRouterLSAsArraySize();
1032  EV_DEBUG << "Parsing ROUTER_LSAs, lsaCount = " << lsaCount << "\n";
1033  break;
1034 
1035  case NETWORK_LSA:
1036  lsaCount = lsUpdatePacket->getNetworkLSAsArraySize();
1037  EV_DEBUG << "Parsing NETWORK_LSAs, lsaCount = " << lsaCount << "\n";
1038  break;
1039 
1040  case INTER_AREA_PREFIX_LSA:
1041  lsaCount = lsUpdatePacket->getInterAreaPrefixLSAsArraySize();
1042  EV_DEBUG << "Parsing InterAreaPrefixLSAs, lsaCount = " << lsaCount << endl;
1043  break;
1044  case INTER_AREA_ROUTER_LSA: // support of LSA type 4 and 5 is not implemented yet
1045  currentType++;
1046  continue;
1047  break;
1048 
1049  case AS_EXTERNAL_LSA:
1050  currentType += 2;
1051  continue;
1052  break;
1053 
1054  case NSSA_LSA:
1055  currentType++;
1056  continue;
1057  break;
1058 
1059  case LINK_LSA:
1060  lsaCount = lsUpdatePacket->getLinkLSAsArraySize();
1061  EV_DEBUG << "Parsing LINK_LSAs, lsaCount = " << lsaCount << "\n";
1062  break;
1063 
1064  case INTRA_AREA_PREFIX_LSA:
1065  lsaCount = lsUpdatePacket->getIntraAreaPrefixLSAsArraySize();
1066  EV_DEBUG << "Parsing INTRA_AREA_PREFIX_LSAs, lsaCount = " << lsaCount << "\n";
1067  break;
1068  default:
1069  throw cRuntimeError("Invalid currentType:%d", currentType);
1070  }
1071 
1072  for (unsigned int i = 0; i < lsaCount; i++) {
1073  const Ospfv3Lsa *currentLSA = nullptr;
1074 
1075  switch (currentType) {
1076  case ROUTER_LSA:
1077  currentLSA = (&(lsUpdatePacket->getRouterLSAs(i)));
1078  break;
1079 
1080  case NETWORK_LSA:
1081  EV_DEBUG << "Caught NETWORK_LSA in LSU\n";
1082  currentLSA = (&(lsUpdatePacket->getNetworkLSAs(i)));
1083  break;
1084 
1085  case INTER_AREA_PREFIX_LSA:
1086  EV_DEBUG << "Caught INTER_AREA_PREFIX_LSA in Update\n";
1087  currentLSA = (&(lsUpdatePacket->getInterAreaPrefixLSAs(i)));
1088  break;
1089 
1090  case INTER_AREA_ROUTER_LSA: // TODO this LSAs are not implemented yet, so they are not processed (with acutal code, this case should never happen)
1091  case AS_EXTERNAL_LSA:
1092  throw cRuntimeError("ProcessLSU - managing LSA of type 4 or 5 - not implemented yet! ");
1093  break;
1094 
1095  case NSSA_LSA:
1096  break;
1097 
1098  case LINK_LSA:
1099  currentLSA = (&(lsUpdatePacket->getLinkLSAs(i)));
1100  break;
1101 
1102  case INTRA_AREA_PREFIX_LSA:
1103  EV_DEBUG << "Caught INTRA_AREA_PREFIX_LSA in LSU\n";
1104  currentLSA = (&(lsUpdatePacket->getIntraAreaPrefixLSAs(i)));
1105  break;
1106 
1107  default:
1108  throw cRuntimeError("Invalid currentType:%d", currentType);
1109  }
1110 
1111  LSAKeyType lsaKey;
1112  lsaKey.linkStateID = currentLSA->getHeader().getLinkStateID();
1113  lsaKey.advertisingRouter = currentLSA->getHeader().getAdvertisingRouter();
1114  lsaKey.LSType = currentLSA->getHeader().getLsaType();
1115 
1116  Ospfv3Lsa *lsaInDatabase = this->getArea()->getInstance()->getProcess()->findLSA(lsaKey, areaID, lsUpdatePacket->getInstanceID());
1117 
1118  unsigned short lsAge = currentLSA->getHeader().getLsaAge();
1119  AcknowledgementFlags ackFlags;
1120 
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);
1127  // if LSA is not in DB, lsaInsDatabae == nullptr , and this flag is TRUE
1128  ackFlags.noLSAInstanceInDatabase = (lsaInDatabase == nullptr);
1129 
1130  // LSA has max_age, it is not in the database and no router is in exchange or loading state
1131  if ((ackFlags.lsaReachedMaxAge) && (ackFlags.noLSAInstanceInDatabase) && (!ackFlags.anyNeighborInExchangeOrLoadingState)) {
1132  // a) send ACK
1133  if (this->getType() == Ospfv3Interface::BROADCAST_TYPE) {
1137  {
1138  EV_DEBUG << "Sending ACK to all\n";
1139  this->sendLSAcknowledgement(&(currentLSA->getHeader()), Ipv6Address::ALL_OSPF_ROUTERS_MCAST);
1140  }
1141  else {
1142  EV_DEBUG << "Sending ACK to Designated mcast\n";
1143  this->sendLSAcknowledgement(&(currentLSA->getHeader()), Ipv6Address::ALL_OSPF_DESIGNATED_ROUTERS_MCAST);
1144  }
1145  }
1146  else {
1148  EV_DEBUG << "Sending ACK to all\n";
1149  this->sendLSAcknowledgement(&(currentLSA->getHeader()), Ipv6Address::ALL_OSPF_ROUTERS_MCAST);
1150  }
1151  else {
1152  EV_DEBUG << "Sending ACK only to neighbor\n";
1153  this->sendLSAcknowledgement(&(currentLSA->getHeader()), neighbor->getNeighborIP());
1154  }
1155  }
1156  // b)discard
1157  continue;
1158  }
1159 
1160  // LSA is in database
1161  if (!ackFlags.noLSAInstanceInDatabase) {
1162  // operator< and operator== on OSPFLSAHeaders determines which one is newer(less means older)
1163  ackFlags.lsaIsNewer = (lsaInDatabase->getHeader() < currentLSA->getHeader());
1164  ackFlags.lsaIsDuplicate = (operator==(lsaInDatabase->getHeader(), currentLSA->getHeader()));
1165  }
1166 
1167  if ((ackFlags.noLSAInstanceInDatabase) || (ackFlags.lsaIsNewer)) {
1168  EV_DEBUG << "No lsa instance in database\n";
1169 
1170  LSATrackingInfo *info = (!ackFlags.noLSAInstanceInDatabase) ? dynamic_cast<LSATrackingInfo *>(lsaInDatabase) : nullptr;
1171  // a) LSA in database and it was installed less than MinLsArrival seconds ago
1172  if ((!ackFlags.noLSAInstanceInDatabase) && // if LSA in Database exists
1173  (lsaInDatabase->getHeader().getAdvertisingRouter() != this->getArea()->getInstance()->getProcess()->getRouterID()) &&
1174  info != nullptr &&
1175  info->getInstallTime() < MIN_LS_ARRIVAL)
1176  { // it should be discarded and no ack should be sent
1177  continue;
1178  }
1179 
1180  // b)immediately flood the LSA
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);
1184 
1185  // if this is BACKBONE area, flood Inter-Area-Prefix LSAs to other areas
1186  if ((currentLSA->getHeader().getLsaType() == INTER_AREA_PREFIX_LSA) &&
1187  (this->getArea()->getInstance()->getAreaCount() > 1) &&
1188  (this->getArea()->getAreaID() == BACKBONE_AREAID))
1189  {
1190  this->getArea()->originateInterAreaPrefixLSA(currentLSA, this->getArea());
1191  }
1192  if (!ackFlags.noLSAInstanceInDatabase) {
1193  LSAKeyType lsaKey;
1194 
1195  lsaKey.linkStateID = lsaInDatabase->getHeader().getLinkStateID();
1196  lsaKey.advertisingRouter = lsaInDatabase->getHeader().getAdvertisingRouter();
1197  lsaKey.LSType = lsaInDatabase->getHeader().getLsaType();
1198  // c) remove the copy from retransmission lists
1200  }
1201  // d) install LSA in the database
1202 
1203  bool installSuccessfull = false;
1204  EV_DEBUG << "Installing the LSA\n";
1205  if (currentType == LINK_LSA) {
1206  installSuccessfull = this->getArea()->getInstance()->getProcess()->installLSA(currentLSA, this->getArea()->getInstance()->getInstanceID(), this->getArea()->getAreaID(), this);
1207  }
1208  else if (currentType == ROUTER_LSA || currentType == NETWORK_LSA || currentType == INTER_AREA_PREFIX_LSA || currentType == INTRA_AREA_PREFIX_LSA) {
1209  installSuccessfull = this->getArea()->getInstance()->getProcess()->installLSA(currentLSA, this->getArea()->getInstance()->getInstanceID(), this->getArea()->getAreaID());
1210  }
1211  if ((installSuccessfull == false) && (ackFlags.lsaIsNewer == false)) {
1212  ackFlags.lsaIsDuplicate = true; // it is not exactly Duplicate, but its LSU which I probably manage earlier and newer version came in less than Update Retranssmision Timer was triggered, so manage it as duplicate
1213  }
1214  rebuildRoutingTable |= installSuccessfull;
1215 
1216  EV_INFO << "(update installed)\n";
1217 
1218 // this->addDelayedAcknowledgement(currentLSA->getHeader());
1219  this->acknowledgeLSA(currentLSA->getHeader(), ackFlags, lsUpdatePacket->getRouterID());
1220  if ((currentLSA->getHeader().getAdvertisingRouter() == this->getArea()->getInstance()->getProcess()->getRouterID()) ||
1221  ((lsaType == NETWORK_LSA) &&
1222  (currentLSA->getHeader().getAdvertisingRouter() == this->getArea()->getInstance()->getProcess()->getRouterID())))
1223  {
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";
1229  this->getArea()->getInstance()->getProcess()->floodLSA(lsaCopy, areaID, this);
1230  }
1231  else {
1232  LSAKeyType lsaKey;
1233 
1234  lsaKey.linkStateID = currentLSA->getHeader().getLinkStateID();
1235  lsaKey.advertisingRouter = currentLSA->getHeader().getAdvertisingRouter();
1236  lsaKey.LSType = currentLSA->getHeader().getLsaType();
1237  neighbor->removeFromRequestList(lsaKey);
1238  }
1239  delete lsaCopy;
1240  }
1241  else {
1242  if (ackFlags.lsaIsNewer) {
1243  long sequenceNumber = currentLSA->getHeader().getLsaSequenceNumber();
1244  if (sequenceNumber == MAX_SEQUENCE_NUMBER) {
1245  lsaInDatabase->getHeaderForUpdate().setLsaAge(MAX_AGE);
1246  EV_DEBUG << "flood LSA in lsaIsNewer\n";
1247  this->getArea()->getInstance()->getProcess()->floodLSA(lsaInDatabase, areaID, this);
1248  }
1249  else {
1250  lsaInDatabase->getHeaderForUpdate().setLsaSequenceNumber(sequenceNumber + 1);
1251  this->getArea()->getInstance()->getProcess()->floodLSA(lsaInDatabase, areaID, this);
1252  }
1253  }
1254  }
1255  }
1256  continue;
1257  }
1258  if (ackFlags.lsaIsDuplicate) {
1259  if (neighbor->isLinkStateRequestListEmpty(lsaKey)) {
1260  neighbor->removeFromRetransmissionList(lsaKey);
1261  ackFlags.impliedAcknowledgement = true;
1262  }
1263  acknowledgeLSA(currentLSA->getHeader(), ackFlags, lsUpdatePacket->getRouterID());
1264  continue;
1265  }
1266  if ((lsaInDatabase->getHeader().getLsaAge() == MAX_AGE) &&
1267  (lsaInDatabase->getHeader().getLsaSequenceNumber() == MAX_SEQUENCE_NUMBER))
1268  {
1269  continue;
1270  }
1271  } // for (unsigned int i = 0; i < lsaCount; i++)
1272 
1273  currentType++;
1274  } // while (currentType >= ROUTER_LSA && currentType <= LINK_LSA) {
1275  } // if (neighbor->getState()>=Ospfv3Neighbor::EXCHANGE_STATE)STATE)
1276  else {
1277  EV_DEBUG << "Neighbor in lesser than EXCHANGE_STATE -> Drop the packet\n";
1278  }
1279 
1280  if (rebuildRoutingTable)
1282 
1283  delete packet;
1284 } // processLSU

Referenced by inet::ospfv3::Ospfv3Instance::processPacket().

◆ removeFromAllRetransmissionLists()

void inet::ospfv3::Ospfv3Interface::removeFromAllRetransmissionLists ( LSAKeyType  lsaKey)
1676 {
1677  long neighborCount = getNeighborCount();
1678  for (long i = 0; i < neighborCount; i++) {
1679  neighbors[i]->removeFromRetransmissionList(lsaKey);
1680  }
1681 }

◆ removeNeighborByID()

void inet::ospfv3::Ospfv3Interface::removeNeighborByID ( Ipv4Address  neighborID)
1701 {
1702  auto neighborIt = this->neighborsById.find(neighborId);
1703  if (neighborIt != this->neighborsById.end()) {
1704  this->neighborsById.erase(neighborIt);
1705  }
1706 
1707  int neighborCnt = this->getNeighborCount();
1708  for (int i = 0; i < neighborCnt; i++) {
1709  Ospfv3Neighbor *current = this->getNeighbor(i);
1710  if (current->getNeighborID() == neighborId) {
1711  this->neighbors.erase(this->neighbors.begin() + i);
1712  break;
1713  }
1714  }
1715 } // removeNeighborById

Referenced by inet::ospfv3::Ospfv3Process::handleTimer().

◆ reset()

◆ sendDelayedAcknowledgements()

void inet::ospfv3::Ospfv3Interface::sendDelayedAcknowledgements ( )
1457 {
1458  EV_DEBUG << "calling send delayded ack\n";
1459  for (auto& elem : delayedAcknowledgements) {
1460  int ackCount = elem.second.size();
1461  if (ackCount > 0) {
1462  while (!(elem.second.empty())) {
1463  const auto& ackPacket = makeShared<Ospfv3LinkStateAcknowledgementPacket>();
1464  B packetSize = OSPFV3_HEADER_LENGTH;
1465 
1466  ackPacket->setType(ospf::LINKSTATE_ACKNOWLEDGEMENT_PACKET);
1467  ackPacket->setRouterID(this->getArea()->getInstance()->getProcess()->getRouterID());
1468  ackPacket->setAreaID(this->getArea()->getAreaID());
1469  ackPacket->setCrc(0);
1470  ackPacket->setInstanceID(this->getArea()->getInstance()->getInstanceID());
1471 
1472  while (!elem.second.empty()) {
1473  unsigned long headerCount = ackPacket->getLsaHeadersArraySize();
1474  ackPacket->setLsaHeadersArraySize(headerCount + 1);
1475  ackPacket->setLsaHeaders(headerCount, *(elem.second.begin()));
1476  elem.second.pop_front();
1477  packetSize += OSPFV3_LSA_HEADER_LENGTH;
1478  }
1479 
1480  ackPacket->setPacketLengthField(packetSize.get());
1481  ackPacket->setChunkLength(packetSize);
1482 
1484 
1485  Packet *pk = new Packet();
1486  pk->insertAtBack(ackPacket);
1487 
1492  {
1493  EV_DEBUG << "send ack 1\n";
1494  this->getArea()->getInstance()->getProcess()->sendPacket(pk, Ipv6Address::ALL_OSPF_ROUTERS_MCAST, this->getIntName().c_str(), ttl);
1495  }
1496  else {
1497  EV_DEBUG << "send ack 2\n";
1499  }
1500  }
1501  else {
1503  EV_DEBUG << "send ack 3\n";
1504  this->getArea()->getInstance()->getProcess()->sendPacket(pk, Ipv6Address::ALL_OSPF_ROUTERS_MCAST, this->getIntName().c_str(), ttl);
1505  }
1506  else {
1507  EV_DEBUG << "send ack 4\n";
1508  this->getArea()->getInstance()->getProcess()->sendPacket(pk, elem.first, this->getIntName().c_str(), ttl);
1509  }
1510  }
1511  }
1512  }
1513  }
1515 } // sendDelayedAcknowledgements

Referenced by inet::ospfv3::Ospfv3InterfaceStateDr::processEvent(), inet::ospfv3::Ospfv3InterfaceStateDrOther::processEvent(), inet::ospfv3::Ospfv3InterfaceStateWaiting::processEvent(), inet::ospfv3::Ospfv3InterfaceStatePointToPoint::processEvent(), and inet::ospfv3::Ospfv3InterfaceStateBackup::processEvent().

◆ sendLSAcknowledgement()

void inet::ospfv3::Ospfv3Interface::sendLSAcknowledgement ( const Ospfv3LsaHeader lsaHeader,
Ipv6Address  destination 
)
1407 {
1408  Ospfv3Options options;
1409  const auto& lsAckPacket = makeShared<Ospfv3LinkStateAcknowledgementPacket>();
1410 
1411  lsAckPacket->setType(ospf::LINKSTATE_ACKNOWLEDGEMENT_PACKET);
1412  lsAckPacket->setRouterID(this->getArea()->getInstance()->getProcess()->getRouterID());
1413  lsAckPacket->setAreaID(this->getArea()->getAreaID());
1414  lsAckPacket->setInstanceID(this->getArea()->getInstance()->getInstanceID());
1415 
1416  lsAckPacket->setLsaHeadersArraySize(1);
1417  lsAckPacket->setLsaHeaders(0, *lsaHeader);
1418 
1419  lsAckPacket->setChunkLength(B(OSPFV3_HEADER_LENGTH + OSPFV3_LSA_HEADER_LENGTH));
1420 
1422 
1423  Packet *pk = new Packet();
1424  pk->insertAtBack(lsAckPacket);
1425 
1426  this->getArea()->getInstance()->getProcess()->sendPacket(pk, destination, this->getIntName().c_str(), hopLimit);
1427 } // sendLSAcknowledgement

Referenced by processLSU().

◆ setAckDelay()

void inet::ospfv3::Ospfv3Interface::setAckDelay ( int  newAckDelay)
inline
103 { this->ackDelay = newAckDelay; }

◆ setArea()

void inet::ospfv3::Ospfv3Interface::setArea ( Ospfv3Area area)
inline
143 { this->containingArea = area; }

Referenced by inet::ospfv3::Ospfv3Process::parseConfig().

◆ 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
100 { this->deadInterval = newInterval; }

Referenced by inet::ospfv3::Ospfv3Process::parseConfig().

◆ 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
99 { this->helloInterval = newInterval; }

Referenced by inet::ospfv3::Ospfv3Process::parseConfig().

◆ setInterfaceCost()

void inet::ospfv3::Ospfv3Interface::setInterfaceCost ( int  newInterval)
inline
101 { this->interfaceCost = newInterval; }

Referenced by inet::ospfv3::Ospfv3Process::parseConfig().

◆ setInterfaceIndex()

void inet::ospfv3::Ospfv3Interface::setInterfaceIndex ( int  newIndex)
inline
110 { this->interfaceIndex = newIndex; }

◆ setInterfaceType()

void inet::ospfv3::Ospfv3Interface::setInterfaceType ( Ospfv3InterfaceType  newType)
inline
102 { this->interfaceType = newType; }

◆ setRouterPriority()

void inet::ospfv3::Ospfv3Interface::setRouterPriority ( int  newPriority)
inline
98 { this->routerPriority = newPriority; }

Referenced by inet::ospfv3::Ospfv3Process::parseConfig().

◆ setTransitAreaID()

void inet::ospfv3::Ospfv3Interface::setTransitAreaID ( Ipv4Address  areaId)
inline
111 { this->transitAreaID = areaId; }

◆ setTransitNetInt()

void inet::ospfv3::Ospfv3Interface::setTransitNetInt ( bool  isTransit)
inline

◆ str()

std::string inet::ospfv3::Ospfv3Interface::str ( ) const
override
1910 {
1911  std::stringstream out;
1912 
1913  out << "Interface " << this->getIntName() << " Info:\n";
1914  return out.str();
1915 } // info

◆ updateLinkLSA()

bool inet::ospfv3::Ospfv3Interface::updateLinkLSA ( LinkLSA currentLsa,
const Ospfv3LinkLsa newLsa 
)
1848 {
1849  bool different = linkLSADiffersFrom(currentLsa, newLsa);
1850  (*currentLsa) = (*newLsa);
1851 // currentLsa->getHeaderForUpdate().setLsaAge(0); //reset the age
1852  if (different) {
1853  return true;
1854  }
1855  else {
1856  return false;
1857  }
1858 }

Referenced by ageDatabase(), and installLinkLSA().

Friends And Related Function Documentation

◆ Ospfv3InterfaceState

friend class Ospfv3InterfaceState
friend

Member Data Documentation

◆ 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

Referenced by prepareHello().

◆ containingModule

cModule* inet::ospfv3::Ospfv3Interface::containingModule = nullptr

Referenced by Ospfv3Interface().

◆ containingProcess

Ospfv3Process* inet::ospfv3::Ospfv3Interface::containingProcess = nullptr

◆ deadInterval

short inet::ospfv3::Ospfv3Interface::deadInterval
private

◆ delayedAcknowledgements

std::map<Ipv6Address, std::list<Ospfv3LsaHeader> > inet::ospfv3::Ospfv3Interface::delayedAcknowledgements
private

◆ 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

Referenced by detailedInfo().

◆ helloTimer

cMessage* inet::ospfv3::Ospfv3Interface::helloTimer
private

◆ ift

IInterfaceTable* inet::ospfv3::Ospfv3Interface::ift = nullptr

◆ interfaceAddresses

std::vector<Ipv6AddressRange> inet::ospfv3::Ospfv3Interface::interfaceAddresses
private

◆ 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

Referenced by Ospfv3Interface().

◆ interfaceName

std::string inet::ospfv3::Ospfv3Interface::interfaceName
private

Referenced by Ospfv3Interface(), and processDDPacket().

◆ interfaceType

◆ linkLSAList

std::vector<LinkLSA *> inet::ospfv3::Ospfv3Interface::linkLSAList
private

◆ linkLSAsByID

std::map<Ipv4Address, LinkLSA *> inet::ospfv3::Ospfv3Interface::linkLSAsByID
private

Referenced by ageDatabase().

◆ linkLSASequenceNumber

uint32_t inet::ospfv3::Ospfv3Interface::linkLSASequenceNumber = INITIAL_SEQUENCE_NUMBER
private

Referenced by originateLinkLSA().

◆ mtu

int inet::ospfv3::Ospfv3Interface::mtu
private

◆ neighbors

◆ neighborsById

std::map<Ipv4Address, Ospfv3Neighbor *> inet::ospfv3::Ospfv3Interface::neighborsById
private

◆ 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

Referenced by Ospfv3Interface().

◆ pollInterval

short inet::ospfv3::Ospfv3Interface::pollInterval
private

◆ previousState

Ospfv3InterfaceState* inet::ospfv3::Ospfv3Interface::previousState = nullptr
private

Referenced by changeState(), and ~Ospfv3Interface().

◆ retransmissionInterval

short inet::ospfv3::Ospfv3Interface::retransmissionInterval
private

◆ routerPriority

int inet::ospfv3::Ospfv3Interface::routerPriority
private

◆ state

Ospfv3InterfaceState* inet::ospfv3::Ospfv3Interface::state
private

◆ transitAreaID

Ipv4Address inet::ospfv3::Ospfv3Interface::transitAreaID
private

◆ transitNetworkInterface

bool inet::ospfv3::Ospfv3Interface::transitNetworkInterface
private

Referenced by Ospfv3Interface().

◆ 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:
VIRTUAL_LINK_TTL
#define VIRTUAL_LINK_TTL
Definition: Ospfv2Common.h:36
CHK
#define CHK(x)
Definition: INETDefs.h:87
inet::ospfv3::Ospfv3Interface::getDeadInterval
short getDeadInterval() const
Definition: Ospfv3Interface.h:114
inet::ospfv3::Ospfv3Neighbor::TWOWAY_STATE
@ TWOWAY_STATE
Definition: Ospfv3Neighbor.h:46
inet::ospfv3::Ospfv3Interface::containingArea
Ospfv3Area * containingArea
Definition: Ospfv3Interface.h:218
inet::ospfv3::Ospfv3Interface::NEIGHBOR_CHANGE_EVENT
@ NEIGHBOR_CHANGE_EVENT
Definition: Ospfv3Interface.h:42
inet::ospfv3::Ospfv3Interface::getNeighbor
Ospfv3Neighbor * getNeighbor(int i)
Definition: Ospfv3Interface.h:130
inet::ospfv3::Ospfv3Interface::getInterfaceId
int getInterfaceId() const
Definition: Ospfv3Interface.h:120
inet::ospfv3::Ospfv3Neighbor::TWOWAY_RECEIVED
@ TWOWAY_RECEIVED
Definition: Ospfv3Neighbor.h:25
inet::ospf::LINKSTATE_ACKNOWLEDGEMENT_PACKET
@ LINKSTATE_ACKNOWLEDGEMENT_PACKET
Definition: OspfPacketBase_m.h:69
inet::Ipv4Address::getInt
uint32_t getInt() const
Returns the address as an uint32_t in host byte order (e.g.
Definition: Ipv4Address.h:186
inet::ospfv3::Ospfv3Interface::passiveInterface
bool passiveInterface
Definition: Ospfv3Interface.h:206
inet::ospfv3::Ospfv3LsaHeader::getAdvertisingRouter
virtual const ::inet::Ipv4Address & getAdvertisingRouter() const
inet::ospfv3::Ospfv3Neighbor::FULL_STATE
@ FULL_STATE
Definition: Ospfv3Neighbor.h:50
inet::ospfv3::Ospfv3Interface::NBMA_TYPE
@ NBMA_TYPE
Definition: Ospfv3Interface.h:54
inet::ospfv3::Ospfv3Lsa::getHeader
virtual const Ospfv3LsaHeader & getHeader() const
inet::ospfv3::Ospfv3LsaHeader::getLsaAge
virtual unsigned short getLsaAge() const
inet::ospfv3::Ospfv3Interface::BROADCAST_TYPE
@ BROADCAST_TYPE
Definition: Ospfv3Interface.h:53
inet::ospfv3::Ospfv3Interface::interfaceAddresses
std::vector< Ipv6AddressRange > interfaceAddresses
Definition: Ospfv3Interface.h:222
inet::ospfv3::Ospfv3Interface::updateLinkLSA
bool updateLinkLSA(LinkLSA *currentLsa, const Ospfv3LinkLsa *newLsa)
Definition: Ospfv3Interface.cc:1847
inet::ospfv3::NSSA
@ NSSA
Definition: Ospfv3Area.h:23
MAX_SEQUENCE_NUMBER
#define MAX_SEQUENCE_NUMBER
Definition: Ospfv2Common.h:34
inet::ospfv3::Ospfv3Interface::INTERFACE_STATE_DROTHER
@ INTERFACE_STATE_DROTHER
Definition: Ospfv3Interface.h:31
inet::ospfv3::Ospfv3Neighbor::DOWN_STATE
@ DOWN_STATE
Definition: Ospfv3Neighbor.h:43
inet::ospfv3::Ospfv3Interface::INTERFACE_STATE_WAITING
@ INTERFACE_STATE_WAITING
Definition: Ospfv3Interface.h:29
inet::ospfv3::Ospfv3Interface::getType
Ospfv3InterfaceType getType() const
Definition: Ospfv3Interface.h:129
inet::ospfv3::Ospfv3Instance::getProcess
Ospfv3Process * getProcess() const
Definition: Ospfv3Instance.h:32
inet::ospfv3::OSPFV3_LINK_LSA_BODY_LENGTH
const B OSPFV3_LINK_LSA_BODY_LENGTH
Definition: Ospfv3Common.h:74
inet::ospfv3::Ospfv3Interface::containingProcess
Ospfv3Process * containingProcess
Definition: Ospfv3Interface.h:89
inet::ospfv3::Ospfv3Instance::getAreaCount
int getAreaCount()
Definition: Ospfv3Instance.h:43
inet::count
int count(const std::vector< T > &v, const Tk &a)
Definition: stlutils.h:54
inet::ospfv3::Ospfv3Interface::ospfv3IntStateOutput
const char * ospfv3IntStateOutput[7]
Definition: Ospfv3Interface.h:59
inet::ospfv3::Ospfv3Interface::getBackupIP
Ipv6Address getBackupIP() const
Definition: Ospfv3Interface.h:132
inet::ospfv3::Ospfv3Neighbor::EXCHANGE_START_STATE
@ EXCHANGE_START_STATE
Definition: Ospfv3Neighbor.h:47
inet::ospfv3::Ospfv3Interface::NEIGHBOR_REVIVED_EVENT
@ NEIGHBOR_REVIVED_EVENT
Definition: Ospfv3Interface.h:47
inet::ospfv3::Ospfv3Interface::preProcessDDPacket
bool preProcessDDPacket(Packet *packet, Ospfv3Neighbor *neighbor, bool inExchangeStart)
Definition: Ospfv3Interface.cc:750
inet::ospfv3::Ospfv3Neighbor::SLAVE
@ SLAVE
Definition: Ospfv3Neighbor.h:55
inet::ospfv3::Ospfv3Neighbor::ATTEMPT_STATE
@ ATTEMPT_STATE
Definition: Ospfv3Neighbor.h:44
inet::ospfv3::Ospfv3Interface::INTERFACE_STATE_LOOPBACK
@ INTERFACE_STATE_LOOPBACK
Definition: Ospfv3Interface.h:28
inet::ospfv3::Ospfv3Process::findLSA
Ospfv3Lsa * findLSA(LSAKeyType lsaKey, Ipv4Address areaID, int instanceID)
Definition: Ospfv3Process.cc:744
inet::ospfv3::Ospfv3Interface::ospfv3IntTypeOutput
const char * ospfv3IntTypeOutput[6]
Definition: Ospfv3Interface.h:69
inet::ospfv3::Ospfv3Interface::transitAreaID
Ipv4Address transitAreaID
Definition: Ospfv3Interface.h:219
inet::ospfv3::Ospfv3Interface::originateLinkLSA
LinkLSA * originateLinkLSA()
Definition: Ospfv3Interface.cc:1728
inet::ospfv3::Ospfv3Interface::acknowledgementTimer
cMessage * acknowledgementTimer
Definition: Ospfv3Interface.h:242
inet::ospfv3::Ospfv3Interface::getTransDelayInterval
short getTransDelayInterval() const
Definition: Ospfv3Interface.h:116
inet::ospfv3::Ospfv3InterfaceState::getInterfaceStateString
virtual std::string getInterfaceStateString() const =0
inet::ospfv3::Ospfv3Interface::interfaceId
int interfaceId
Definition: Ospfv3Interface.h:201
inet::ospfv3::Ospfv3Interface::helloTimer
cMessage * helloTimer
Definition: Ospfv3Interface.h:240
L3AddressInd
removed DscpReq Ipv4ControlInfo Ipv6ControlInfo up L3AddressInd L3AddressInd
Definition: IUdp-gates.txt:20
inet::ospfv3::HELLO_TIMER
@ HELLO_TIMER
Definition: Ospfv3Timers.h:9
inet::ospfv3::Ospfv3Interface::prepareHello
Packet * prepareHello()
Definition: Ospfv3Interface.cc:226
inet::ospfv3::Ospfv3Interface::state
Ospfv3InterfaceState * state
Definition: Ospfv3Interface.h:207
inet::ospfv3::Ospfv3Interface::getIntName
std::string getIntName() const
Definition: Ospfv3Interface.h:95
inet::ospfv3::Ospfv3Interface::routerPriority
int routerPriority
Definition: Ospfv3Interface.h:215
inet::ospfv3::Ospfv3Interface::prepareUpdatePacket
Packet * prepareUpdatePacket(std::vector< Ospfv3Lsa * > lsas)
Definition: Ospfv3Interface.cc:912
inet::ospfv3::Ospfv3Process::isInRoutingTable6
int isInRoutingTable6(Ipv6RoutingTable *rtTable, Ipv6Address addr)
Definition: Ospfv3Process.cc:104
inet::ospfv3::Ospfv3Neighbor::ONEWAY_RECEIVED
@ ONEWAY_RECEIVED
Definition: Ospfv3Neighbor.h:32
inet::ospfv3::Ospfv3Process::sendPacket
void sendPacket(Packet *packet, Ipv6Address destination, const char *ifName, short hopLimit=1)
Definition: Ospfv3Process.cc:690
inet::ospfv3::Ospfv3Interface::deadInterval
short deadInterval
Definition: Ospfv3Interface.h:210
MAX_AGE
#define MAX_AGE
Definition: Ospfv2Common.h:27
inet::ospfv3::Ospfv3Interface::getLinkLSAbyKey
LinkLSA * getLinkLSAbyKey(LSAKeyType lsaKey)
Definition: Ospfv3Interface.cc:1814
inet::ospfv3::Ospfv3Interface::INTERFACE_PASSIVE
@ INTERFACE_PASSIVE
Definition: Ospfv3Interface.h:34
inet::ospfv3::Ospfv3InterfaceState::getState
virtual Ospfv3Interface::Ospfv3InterfaceFaState getState() const =0
DEFAULT_ROUTER_PRIORITY
#define DEFAULT_ROUTER_PRIORITY
Definition: Ospfv3Common.h:19
inet::ospfv3::INTRA_AREA_PREFIX_LSA
@ INTRA_AREA_PREFIX_LSA
Definition: Ospfv3Packet_m.h:404
inet::ospfv3::Ospfv3Interface::DesignatedRouterIP
Ipv6Address DesignatedRouterIP
Definition: Ospfv3Interface.h:233
inet::ospfv3::NETWORK_LSA
@ NETWORK_LSA
Definition: Ospfv3Packet_m.h:397
inet::ospfv3::Ospfv3Process::rebuildRoutingTable
void rebuildRoutingTable()
Definition: Ospfv3Process.cc:840
inet::ospfv3::Ospfv3Interface::acknowledgeLSA
void acknowledgeLSA(const Ospfv3LsaHeader &lsaHeader, AcknowledgementFlags ackFlags, Ipv4Address routerID)
Definition: Ospfv3Interface.cc:1321
inet::ospfv3::Ospfv3Interface::getDesignatedID
Ipv4Address getDesignatedID() const
Definition: Ospfv3Interface.h:133
inet::ospf::HELLO_PACKET
@ HELLO_PACKET
Definition: OspfPacketBase_m.h:65
inet::ospfv3::Ospfv3Process::getProcessID
int getProcessID() const
Definition: Ospfv3Process.h:39
inet::ospfv3::ACKNOWLEDGEMENT_TIMER
@ ACKNOWLEDGEMENT_TIMER
Definition: Ospfv3Timers.h:16
inet::ospf::LINKSTATE_UPDATE_PACKET
@ LINKSTATE_UPDATE_PACKET
Definition: OspfPacketBase_m.h:68
inet::ospfv3::Ospfv3Interface::linkLSAsByID
std::map< Ipv4Address, LinkLSA * > linkLSAsByID
Definition: Ospfv3Interface.h:226
inet::ospfv3::Ospfv3Area::getInstance
Ospfv3Instance * getInstance() const
Definition: Ospfv3Area.h:41
inet::IInterfaceTable::getInterfaceById
virtual NetworkInterface * getInterfaceById(int id) const =0
Returns an interface by its Id.
inet::ospfv3::LINK_LSA
@ LINK_LSA
Definition: Ospfv3Packet_m.h:403
IPV4INSTANCE
#define IPV4INSTANCE
Definition: Ospfv3Common.h:20
inet::ospfv3::Ospfv3InterfaceState::processEvent
virtual void processEvent(Ospfv3Interface *interface, Ospfv3Interface::Ospfv3InterfaceEvent eventNum)=0
inet::ospfv3::Ospfv3Interface::LOOP_IND_EVENT
@ LOOP_IND_EVENT
Definition: Ospfv3Interface.h:44
inet::ospfv3::Ospfv3Interface::neighborsById
std::map< Ipv4Address, Ospfv3Neighbor * > neighborsById
Definition: Ospfv3Interface.h:224
inet::ospfv3::Ospfv3Interface::isOnAnyRetransmissionList
bool isOnAnyRetransmissionList(LSAKeyType lsaKey) const
Definition: Ospfv3Interface.cc:1683
inet::ospfv3::Ospfv3Process::installLSA
bool installLSA(const Ospfv3Lsa *lsaC, int instanceID, Ipv4Address areaID=Ipv4Address::UNSPECIFIED_ADDRESS, Ospfv3Interface *intf=nullptr)
Definition: Ospfv3Process.cc:779
INITIAL_SEQUENCE_NUMBER
#define INITIAL_SEQUENCE_NUMBER
Definition: Ospfv2Common.h:33
inet::IInterfaceTable::findInterfaceByName
virtual NetworkInterface * findInterfaceByName(const char *name) const =0
Returns an interface given by its name.
inet::ospfv3::Ospfv3Neighbor::SEQUENCE_NUMBER_MISMATCH
@ SEQUENCE_NUMBER_MISMATCH
Definition: Ospfv3Neighbor.h:31
inet::ospfv3::BACKBONE_AREAID
const Ipv4Address BACKBONE_AREAID(0, 0, 0, 0)
inet::ospfv3::Ospfv3Interface::getRetransmissionInterval
short getRetransmissionInterval() const
Definition: Ospfv3Interface.h:117
inet::ospfv3::Ospfv3Interface::addDelayedAcknowledgement
void addDelayedAcknowledgement(const Ospfv3LsaHeader &lsaHeader)
Definition: Ospfv3Interface.cc:1429
inet::ospfv3::Ospfv3Instance::getAddressFamily
int getAddressFamily()
Definition: Ospfv3Instance.h:31
inet::ospfv3::Ospfv3Interface::waitTimer
cMessage * waitTimer
Definition: Ospfv3Interface.h:241
inet::ospfv3::Ospfv3Interface::HELLO_TIMER_EVENT
@ HELLO_TIMER_EVENT
Definition: Ospfv3Interface.h:45
inet::ospfv3::Ospfv3Interface::INTERFACE_STATE_DOWN
@ INTERFACE_STATE_DOWN
Definition: Ospfv3Interface.h:27
inet::ospfv3::Ospfv3Interface::ackDelay
short ackDelay
Definition: Ospfv3Interface.h:214
inet::ospfv3::Ospfv3Interface::getBackupID
Ipv4Address getBackupID() const
Definition: Ospfv3Interface.h:134
inet::ospfv3::Ospfv3Interface::getRouterPriority
int getRouterPriority() const
Definition: Ospfv3Interface.h:112
inet::ospfv3::Ospfv3Process::getRouterID
Ipv4Address getRouterID()
Definition: Ospfv3Process.h:40
inet::ospfv3::Ospfv3Interface::UNLOOP_IND_EVENT
@ UNLOOP_IND_EVENT
Definition: Ospfv3Interface.h:39
inet::units::units::B
intscale< b, 1, 8 > B
Definition: Units.h:1168
inet::ospfv3::Ospfv3Interface::INTERFACE_UP_EVENT
@ INTERFACE_UP_EVENT
Definition: Ospfv3Interface.h:38
inet::ospfv3::Ospfv3Neighbor::NEGOTIATION_DONE
@ NEGOTIATION_DONE
Definition: Ospfv3Neighbor.h:26
inet::ospfv3::Ospfv3Interface::BackupRouterID
Ipv4Address BackupRouterID
Definition: Ospfv3Interface.h:236
inet::ospfv3::NSSA_LSA
@ NSSA_LSA
Definition: Ospfv3Packet_m.h:402
inet::ospfv3::AS_EXTERNAL_LSA
@ AS_EXTERNAL_LSA
Definition: Ospfv3Packet_m.h:400
inet::ospfv3::calculateLSASize
B calculateLSASize(const Ospfv3RouterLsa *routerLSA)
Definition: Ospfv3Lsa.cc:19
inet::ospfv3::WAIT_TIMER
@ WAIT_TIMER
Definition: Ospfv3Timers.h:10
inet::Ipv6Address::UNSPECIFIED_ADDRESS
static const Ipv6Address UNSPECIFIED_ADDRESS
The unspecified address.
Definition: Ipv6Address.h:54
inet::ospfv3::Ospfv3Interface::getInterfaceCost
int getInterfaceCost() const
Definition: Ospfv3Interface.h:119
inet::ospfv3::Ospfv3Neighbor::MASTER
@ MASTER
Definition: Ospfv3Neighbor.h:54
inet::ospfv3::Ospfv3Interface::DesignatedIntID
int DesignatedIntID
Definition: Ospfv3Interface.h:237
inet::ospfv3::Ospfv3Interface::interfaceCost
int interfaceCost
Definition: Ospfv3Interface.h:238
inet::ospfv3::Ospfv3Interface::POINTTOMULTIPOINT_TYPE
@ POINTTOMULTIPOINT_TYPE
Definition: Ospfv3Interface.h:55
inet::ospfv3::Ospfv3Neighbor::EXCHANGE_DONE
@ EXCHANGE_DONE
Definition: Ospfv3Neighbor.h:27
inet::ospfv3::Ospfv3Neighbor::Ospfv3NeighborStateType
Ospfv3NeighborStateType
Definition: Ospfv3Neighbor.h:42
inet::ospfv3::Ospfv3Interface::floodLSA
bool floodLSA(const Ospfv3Lsa *lsa, Ospfv3Interface *interface=nullptr, Ospfv3Neighbor *neighbor=nullptr)
Definition: Ospfv3Interface.cc:1520
inet::ospfv3::Ospfv3Neighbor::BAD_LINK_STATE_REQUEST
@ BAD_LINK_STATE_REQUEST
Definition: Ospfv3Neighbor.h:28
inet::ospfv3::Ospfv3Instance::removeFromAllRetransmissionLists
void removeFromAllRetransmissionLists(LSAKeyType lsaKey)
Definition: Ospfv3Instance.cc:143
inet::ospfv3::OSPFV3_LSA_HEADER_LENGTH
const B OSPFV3_LSA_HEADER_LENGTH
Definition: Ospfv3Common.h:59
inet::ospfv3::Ospfv3Interface::hasAnyNeighborInState
bool hasAnyNeighborInState(int state) const
Definition: Ospfv3Interface.cc:109
inet::ospfv3::Ospfv3Interface::POINTTOPOINT_TYPE
@ POINTTOPOINT_TYPE
Definition: Ospfv3Interface.h:52
inet::ospfv3::Ospfv3Interface::getNeighborCount
int getNeighborCount() const
Definition: Ospfv3Interface.h:122
inet::ospfv3::Ospfv3Interface::transmissionDelay
short transmissionDelay
Definition: Ospfv3Interface.h:212
inet::ospfv3::Ospfv3Interface::neighbors
std::vector< Ospfv3Neighbor * > neighbors
Definition: Ospfv3Interface.h:223
inet::ospfv3::Ospfv3Interface::linkLSADiffersFrom
bool linkLSADiffersFrom(Ospfv3LinkLsa *currentLsa, const Ospfv3LinkLsa *newLsa)
Definition: Ospfv3Interface.cc:1860
inet::Ipv4Address::str
std::string str(bool printUnspec=true) const
Returns the string representation of the address (e.g.
Definition: Ipv4Address.cc:98
inet::ospfv3::INTER_AREA_PREFIX_LSA
@ INTER_AREA_PREFIX_LSA
Definition: Ospfv3Packet_m.h:398
inet::ospfv3::Ospfv3Process::setTimer
void setTimer(cMessage *msg, double delay)
Definition: Ospfv3Process.cc:654
inet::ospfv3::Ospfv3Interface::getNeighborById
Ospfv3Neighbor * getNeighborById(Ipv4Address neighborId)
Definition: Ospfv3Interface.cc:1694
inet::ospfv3::Ospfv3Area::removeFromAllRetransmissionLists
void removeFromAllRetransmissionLists(LSAKeyType lsaKey)
Definition: Ospfv3Area.cc:943
CHECK_AGE
#define CHECK_AGE
Definition: Ospfv2Common.h:28
inet::ospfv3::Ospfv3Interface::ACKNOWLEDGEMENT_TIMER_EVENT
@ ACKNOWLEDGEMENT_TIMER_EVENT
Definition: Ospfv3Interface.h:46
inet::ospfv3::Ospfv3Interface::getState
Ospfv3Interface::Ospfv3InterfaceFaState getState() const
Definition: Ospfv3Interface.cc:99
inet::ospfv3::Ospfv3Interface::interfaceIndex
int interfaceIndex
Definition: Ospfv3Interface.h:202
inet::ospfv3::Ospfv3Neighbor::IS_ADJACENCY_OK
@ IS_ADJACENCY_OK
Definition: Ospfv3Neighbor.h:30
inet::physicallayer::k
const double k
Definition: Qam1024Modulation.cc:14
inet::ospfv3::Ospfv3Interface::BackupRouterIP
Ipv6Address BackupRouterIP
Definition: Ospfv3Interface.h:234
inet::ospfv3::Ospfv3Interface::DesignatedRouterID
Ipv4Address DesignatedRouterID
Definition: Ospfv3Interface.h:235
inet::ospfv3::Ospfv3Interface::previousState
Ospfv3InterfaceState * previousState
Definition: Ospfv3Interface.h:208
inet::ospfv3::Ospfv3Process::floodLSA
bool floodLSA(const Ospfv3Lsa *lsa, Ipv4Address areaID=Ipv4Address::UNSPECIFIED_ADDRESS, Ospfv3Interface *intf=nullptr, Ospfv3Neighbor *neighbor=nullptr)
Definition: Ospfv3Process.cc:751
inet::ospfv3::Ospfv3Interface::BACKUP_SEEN_EVENT
@ BACKUP_SEEN_EVENT
Definition: Ospfv3Interface.h:41
inet::ospfv3::Ospfv3Interface::VIRTUAL_TYPE
@ VIRTUAL_TYPE
Definition: Ospfv3Interface.h:56
inet::ospfv3::Ospfv3Interface::getDesignatedIP
Ipv6Address getDesignatedIP() const
Definition: Ospfv3Interface.h:131
inet::ospfv3::Ospfv3Area::originateInterAreaPrefixLSA
void originateInterAreaPrefixLSA(Ospfv3IntraAreaPrefixLsa *lsa, Ospfv3Area *fromArea, bool checkDuplicate)
Definition: Ospfv3Area.cc:1117
inet::ospfv3::Ospfv3Process::rt6
ModuleRefByPar< Ipv6RoutingTable > rt6
Definition: Ospfv3Process.h:72
inet::ospfv3::Ospfv3Interface::INTERFACE_DOWN_EVENT
@ INTERFACE_DOWN_EVENT
Definition: Ospfv3Interface.h:43
inet::ospfv3::OSPFV3_HEADER_LENGTH
const B OSPFV3_HEADER_LENGTH
Definition: Ospfv3Common.h:57
inet::Ipv4Address::UNSPECIFIED_ADDRESS
static const Ipv4Address UNSPECIFIED_ADDRESS
0.0.0.0
Definition: Ipv4Address.h:91
inet::ospfv3::Ospfv3Interface::interfaceLLIP
Ipv6Address interfaceLLIP
Definition: Ospfv3Interface.h:204
inet::ospfv3::Ospfv3Instance::getInstanceID
int getInstanceID()
Definition: Ospfv3Instance.h:30
inet::units::value::get
const value_type & get() const
Definition: Units.h:108
inet::ospfv3::Ospfv3Neighbor::EXCHANGE_STATE
@ EXCHANGE_STATE
Definition: Ospfv3Neighbor.h:48
inet::ospfv3::Ospfv3Interface::ift
IInterfaceTable * ift
Definition: Ospfv3Interface.h:90
inet::ospfv3::Ospfv3Interface::sendLSAcknowledgement
void sendLSAcknowledgement(const Ospfv3LsaHeader *lsaHeader, Ipv6Address destination)
Definition: Ospfv3Interface.cc:1406
inet::ospfv3::Ospfv3Interface::retransmissionInterval
short retransmissionInterval
Definition: Ospfv3Interface.h:213
inet::ospfv3::INTER_AREA_ROUTER_LSA
@ INTER_AREA_ROUTER_LSA
Definition: Ospfv3Packet_m.h:399
inet::ospfv3::Ospfv3Neighbor::INIT_STATE
@ INIT_STATE
Definition: Ospfv3Neighbor.h:45
inet::ospfv3::operator==
bool operator==(const VertexID &leftID, const VertexID &rightID)
Definition: Ospfv3Common.h:250
inet::ospfv3::Ospfv3Interface::interfaceName
std::string interfaceName
Definition: Ospfv3Interface.h:205
inet::ospfv3::Ospfv3Interface::WAIT_TIMER_EVENT
@ WAIT_TIMER_EVENT
Definition: Ospfv3Interface.h:40
inet::ospfv3::Ospfv3Interface::pollInterval
short pollInterval
Definition: Ospfv3Interface.h:211
inet::ospfv3::Ospfv3Interface::INTERFACE_STATE_POINTTOPOINT
@ INTERFACE_STATE_POINTTOPOINT
Definition: Ospfv3Interface.h:30
MIN_LS_ARRIVAL
#define MIN_LS_ARRIVAL
Definition: Ospfv2Common.h:26
inet::ospfv3::Ospfv3Interface::addNeighbor
void addNeighbor(Ospfv3Neighbor *)
Definition: Ospfv3Interface.cc:1717
inet::ospfv3::Ospfv3Interface::getArea
Ospfv3Area * getArea() const
Definition: Ospfv3Interface.h:142
inet::ospfv3::Ospfv3Interface::processEvent
void processEvent(Ospfv3Interface::Ospfv3InterfaceEvent)
Definition: Ospfv3Interface.cc:75
inet::ospfv3::Ospfv3Interface::transitNetworkInterface
bool transitNetworkInterface
Definition: Ospfv3Interface.h:229
inet::units::values::m
value< double, units::m > m
Definition: Units.h:1233
inet::Ipv6Address::ALL_OSPF_ROUTERS_MCAST
static const Ipv6Address ALL_OSPF_ROUTERS_MCAST
OSPF multicast address for listening.
Definition: Ipv6Address.h:84
inet::ospfv3::Ospfv3Interface::getLinkLSACount
int getLinkLSACount()
Definition: Ospfv3Interface.h:177
inet::ospfv3::Ospfv3Area::findLSA
const Ospfv3LsaHeader * findLSA(LSAKeyType lsaKey)
Definition: Ospfv3Area.cc:140
inet::ospfv3::Ospfv3Interface::delayedAcknowledgements
std::map< Ipv6Address, std::list< Ospfv3LsaHeader > > delayedAcknowledgements
Definition: Ospfv3Interface.h:225
inet::ospfv3::Ospfv3Interface::linkLSAList
std::vector< LinkLSA * > linkLSAList
Definition: Ospfv3Interface.h:203
DEFAULT_HELLO_INTERVAL
#define DEFAULT_HELLO_INTERVAL
Definition: Ospfv3Common.h:13
LS_REFRESH_TIME
#define LS_REFRESH_TIME
Definition: Ospfv2Common.h:24
inet::ospfv3::ROUTER_LSA
@ ROUTER_LSA
Definition: Ospfv3Packet_m.h:396
inet::ospfv3::Ospfv3Process::clearTimer
void clearTimer(cMessage *msg)
Definition: Ospfv3Process.h:44
inet::ospfv3::Ospfv3Interface::linkLSASequenceNumber
uint32_t linkLSASequenceNumber
Definition: Ospfv3Interface.h:231
inet::ospfv3::Ospfv3Area::getExternalRoutingCapability
bool getExternalRoutingCapability()
Definition: Ospfv3Area.h:48
inet::ospfv3::Ospfv3Interface::helloInterval
short helloInterval
Definition: Ospfv3Interface.h:209
inet::ospfv3::Ospfv3Area::getAreaID
Ipv4Address getAreaID() const
Definition: Ospfv3Area.h:32
inet::ospfv3::Ospfv3Interface::getHelloInterval
short getHelloInterval() const
Definition: Ospfv3Interface.h:113
DEFAULT_DEAD_INTERVAL
#define DEFAULT_DEAD_INTERVAL
Definition: Ospfv3Common.h:14
inet::ospfv3::Ospfv3Interface::containingModule
cModule * containingModule
Definition: Ospfv3Interface.h:88
inet::ospfv3::NULL_IPV4ADDRESS
const Ipv4Address NULL_IPV4ADDRESS(0, 0, 0, 0)
inet::ospfv3::DEPRECATED
@ DEPRECATED
Definition: Ospfv3Packet_m.h:401
inet::Ipv6Address::ALL_OSPF_DESIGNATED_ROUTERS_MCAST
static const Ipv6Address ALL_OSPF_DESIGNATED_ROUTERS_MCAST
OSPF designated routers.
Definition: Ipv6Address.h:87
inet::ospfv3::Ospfv3Interface::UNKNOWN_TYPE
@ UNKNOWN_TYPE
Definition: Ospfv3Interface.h:51
inet::ospfv3::Ospfv3Neighbor::LOADING_STATE
@ LOADING_STATE
Definition: Ospfv3Neighbor.h:49
inet::ospfv3::Ospfv3Interface::INTERFACE_STATE_BACKUP
@ INTERFACE_STATE_BACKUP
Definition: Ospfv3Interface.h:32
inet::ospfv3::Ospfv3Interface::interfaceType
Ospfv3Interface::Ospfv3InterfaceType interfaceType
Definition: Ospfv3Interface.h:220
inet::ospfv3::Ospfv3Interface::INTERFACE_STATE_DESIGNATED
@ INTERFACE_STATE_DESIGNATED
Definition: Ospfv3Interface.h:33