INET Framework for OMNeT++/OMNEST
inet::ospfv2::Ospfv2Interface Class Reference

#include <Ospfv2Interface.h>

Public Types

enum  Ospfv2InterfaceType {
  UNKNOWN_TYPE = 0, POINTTOPOINT = 1, BROADCAST = 2, NBMA = 3,
  POINTTOMULTIPOINT = 4, VIRTUAL = 5
}
 
enum  Ospfv2InterfaceEventType {
  INTERFACE_UP = 0, HELLO_TIMER = 1, WAIT_TIMER = 2, ACKNOWLEDGEMENT_TIMER = 3,
  BACKUP_SEEN = 4, NEIGHBOR_CHANGE = 5, LOOP_INDICATION = 6, UNLOOP_INDICATION = 7,
  INTERFACE_DOWN = 8
}
 
enum  Ospfv2InterfaceStateType {
  DOWN_STATE = 0, LOOPBACK_STATE = 1, WAITING_STATE = 2, POINTTOPOINT_STATE = 3,
  NOT_DESIGNATED_ROUTER_STATE = 4, BACKUP_STATE = 5, DESIGNATED_ROUTER_STATE = 6
}
 
enum  Ospfv2InterfaceMode { ACTIVE = 0, PASSIVE = 1, NO_OSPF = 2 }
 

Public Member Functions

 Ospfv2Interface (Ospfv2InterfaceType ifType=UNKNOWN_TYPE)
 
virtual ~Ospfv2Interface ()
 
void processEvent (Ospfv2InterfaceEventType event)
 
void reset ()
 
void sendHelloPacket (Ipv4Address destination, short ttl=1)
 
void sendLsAcknowledgement (const Ospfv2LsaHeader *lsaHeader, Ipv4Address destination)
 
NeighborgetNeighborById (RouterId neighborID)
 
NeighborgetNeighborByAddress (Ipv4Address address)
 
void addNeighbor (Neighbor *neighbor)
 
Ospfv2InterfaceStateType getState () const
 
bool hasAnyNeighborInStates (int states) const
 
void removeFromAllRetransmissionLists (LsaKeyType lsaKey)
 
bool isOnAnyRetransmissionList (LsaKeyType lsaKey) const
 
bool floodLsa (const Ospfv2Lsa *lsa, Ospfv2Interface *intf=nullptr, Neighbor *neighbor=nullptr)
 
void addDelayedAcknowledgement (const Ospfv2LsaHeader &lsaHeader)
 
void sendDelayedAcknowledgements ()
 
void ageTransmittedLsaLists ()
 
PacketcreateUpdatePacket (const Ospfv2Lsa *lsa)
 
void setType (Ospfv2InterfaceType ifType)
 
Ospfv2InterfaceType getType () const
 
Ospfv2InterfaceMode getMode () const
 
void setMode (Ospfv2InterfaceMode intfMode)
 
CrcMode getCrcMode () const
 
void setCrcMode (CrcMode crcMode)
 
void setIfIndex (IInterfaceTable *ift, int index)
 
int getIfIndex () const
 
void setInterfaceName (std::string ifName)
 
std::string getInterfaceName () const
 
void setMtu (unsigned short ifMTU)
 
unsigned short getMtu () const
 
void setAreaId (AreaId areaId)
 
AreaId getAreaId () const
 
void setTransitAreaId (AreaId areaId)
 
AreaId getTransitAreaId () const
 
void setOutputCost (Metric cost)
 
Metric getOutputCost () const
 
void setRetransmissionInterval (short interval)
 
short getRetransmissionInterval () const
 
void setTransmissionDelay (short delay)
 
short getTransmissionDelay () const
 
void setAcknowledgementDelay (short delay)
 
short getAcknowledgementDelay () const
 
void setRouterPriority (unsigned char priority)
 
unsigned char getRouterPriority () const
 
void setHelloInterval (short interval)
 
short getHelloInterval () const
 
void setPollInterval (short interval)
 
short getPollInterval () const
 
void setRouterDeadInterval (short interval)
 
short getRouterDeadInterval () const
 
void setAuthenticationType (AuthenticationType type)
 
AuthenticationType getAuthenticationType () const
 
void setAuthenticationKey (AuthenticationKeyType key)
 
AuthenticationKeyType getAuthenticationKey () const
 
void setAddressRange (Ipv4AddressRange range)
 
Ipv4AddressRange getAddressRange () const
 
cMessage * getHelloTimer ()
 
cMessage * getWaitTimer ()
 
cMessage * getAcknowledgementTimer ()
 
DesignatedRouterId getDesignatedRouter () const
 
DesignatedRouterId getBackupDesignatedRouter () const
 
unsigned long getNeighborCount () const
 
NeighborgetNeighbor (unsigned long i)
 
const NeighborgetNeighbor (unsigned long i) const
 
void setArea (Ospfv2Area *area)
 
Ospfv2AreagetArea ()
 
const Ospfv2AreagetArea () const
 

Static Public Member Functions

static const char * getStateString (Ospfv2InterfaceStateType stateType)
 
static const char * getTypeString (Ospfv2InterfaceType intfType)
 
static const char * getModeString (Ospfv2InterfaceMode intfMode)
 

Private Member Functions

void changeState (Ospfv2InterfaceState *newState, Ospfv2InterfaceState *currentState)
 

Private Attributes

Ospfv2InterfaceType interfaceType
 
Ospfv2InterfaceMode interfaceMode
 
CrcMode crcMode
 
Ospfv2InterfaceStatestate
 
Ospfv2InterfaceStatepreviousState
 
std::string interfaceName
 
int ifIndex
 
unsigned short mtu
 
Ipv4AddressRange interfaceAddressRange
 
AreaId areaID
 
AreaId transitAreaID
 
short helloInterval
 
short pollInterval
 
short routerDeadInterval
 
short interfaceTransmissionDelay
 
unsigned char routerPriority
 
cMessage * helloTimer
 
cMessage * waitTimer
 
cMessage * acknowledgementTimer
 
std::map< RouterId, Neighbor * > neighboringRoutersByID
 
std::map< Ipv4Address, Neighbor * > neighboringRoutersByAddress
 
std::vector< Neighbor * > neighboringRouters
 
std::map< Ipv4Address, std::list< Ospfv2LsaHeader > > delayedAcknowledgements
 
DesignatedRouterId designatedRouter
 
DesignatedRouterId backupDesignatedRouter
 
Metric interfaceOutputCost
 
short retransmissionInterval
 
short acknowledgementDelay
 
AuthenticationType authenticationType
 
AuthenticationKeyType authenticationKey
 
Ospfv2AreaparentArea
 

Friends

class Ospfv2InterfaceState
 
std::ostream & operator<< (std::ostream &stream, const Ospfv2Interface &intf)
 

Member Enumeration Documentation

◆ Ospfv2InterfaceEventType

Enumerator
INTERFACE_UP 
HELLO_TIMER 
WAIT_TIMER 
ACKNOWLEDGEMENT_TIMER 
BACKUP_SEEN 
NEIGHBOR_CHANGE 
LOOP_INDICATION 
UNLOOP_INDICATION 
INTERFACE_DOWN 
39  {
40  INTERFACE_UP = 0,
41  HELLO_TIMER = 1,
42  WAIT_TIMER = 2,
44  BACKUP_SEEN = 4,
45  NEIGHBOR_CHANGE = 5,
46  LOOP_INDICATION = 6,
48  INTERFACE_DOWN = 8
49  };

◆ Ospfv2InterfaceMode

Enumerator
ACTIVE 
PASSIVE 
NO_OSPF 
61  {
62  ACTIVE = 0,
63  PASSIVE = 1,
64  NO_OSPF = 2,
65  };

◆ Ospfv2InterfaceStateType

Enumerator
DOWN_STATE 
LOOPBACK_STATE 
WAITING_STATE 
POINTTOPOINT_STATE 
NOT_DESIGNATED_ROUTER_STATE 
BACKUP_STATE 
DESIGNATED_ROUTER_STATE 
51  {
52  DOWN_STATE = 0,
53  LOOPBACK_STATE = 1,
54  WAITING_STATE = 2,
57  BACKUP_STATE = 5,
59  };

◆ Ospfv2InterfaceType

Enumerator
UNKNOWN_TYPE 
POINTTOPOINT 
BROADCAST 
NBMA 
POINTTOMULTIPOINT 
VIRTUAL 
30  {
31  UNKNOWN_TYPE = 0,
32  POINTTOPOINT = 1,
33  BROADCAST = 2,
34  NBMA = 3,
36  VIRTUAL = 5
37  };

Constructor & Destructor Documentation

◆ Ospfv2Interface()

inet::ospfv2::Ospfv2Interface::Ospfv2Interface ( Ospfv2Interface::Ospfv2InterfaceType  ifType = UNKNOWN_TYPE)
30  :
31  interfaceType(ifType),
34  interfaceName(""),
35  ifIndex(0),
36  mtu(0),
40  helloInterval(10),
41  pollInterval(120),
44  routerPriority(0),
51  parentArea(nullptr)
52 {
53  state = new InterfaceStateDown;
54  previousState = nullptr;
55  helloTimer = new cMessage("Interface::InterfaceHelloTimer", INTERFACE_HELLO_TIMER);
56  helloTimer->setContextPointer(this);
57  waitTimer = new cMessage("Interface::InterfaceWaitTimer", INTERFACE_WAIT_TIMER);
58  waitTimer->setContextPointer(this);
59  acknowledgementTimer = new cMessage("Interface::InterfaceAcknowledgementTimer", INTERFACE_ACKNOWLEDGEMENT_TIMER);
60  acknowledgementTimer->setContextPointer(this);
61  memset(authenticationKey.bytes, 0, sizeof(authenticationKey.bytes));
62 }

◆ ~Ospfv2Interface()

inet::ospfv2::Ospfv2Interface::~Ospfv2Interface ( )
virtual
65 {
66  if (parentArea) {
67  MessageHandler *messageHandler = parentArea->getRouter()->getMessageHandler();
68  messageHandler->clearTimer(helloTimer);
69  messageHandler->clearTimer(waitTimer);
70  messageHandler->clearTimer(acknowledgementTimer);
71  }
72  delete helloTimer;
73  delete waitTimer;
74  delete acknowledgementTimer;
75  if (previousState)
76  delete previousState;
77  delete state;
78  for (uint32_t i = 0; i < neighboringRouters.size(); i++)
79  delete neighboringRouters[i];
80 }

Member Function Documentation

◆ addDelayedAcknowledgement()

void inet::ospfv2::Ospfv2Interface::addDelayedAcknowledgement ( const Ospfv2LsaHeader lsaHeader)
528 {
533  {
535  }
536  else {
538  }
539  }
540  else {
541  long neighborCount = neighboringRouters.size();
542  for (long i = 0; i < neighborCount; i++) {
544  delayedAcknowledgements[neighboringRouters[i]->getAddress()].push_back(lsaHeader);
545  }
546  }
547  }
548 }

Referenced by inet::ospfv2::LinkStateUpdateHandler::acknowledgeLSA().

◆ addNeighbor()

void inet::ospfv2::Ospfv2Interface::addNeighbor ( Neighbor neighbor)
268 {
269  neighboringRoutersByID[neighbor->getNeighborID()] = neighbor;
270  neighboringRoutersByAddress[neighbor->getAddress()] = neighbor;
271  neighbor->setInterface(this);
272  neighboringRouters.push_back(neighbor);
273 }

Referenced by inet::ospfv2::Ospfv2ConfigReader::loadInterfaceParameters(), inet::ospfv2::Ospfv2ConfigReader::loadVirtualLink(), and inet::ospfv2::HelloHandler::processPacket().

◆ ageTransmittedLsaLists()

void inet::ospfv2::Ospfv2Interface::ageTransmittedLsaLists ( )
615 {
616  long neighborCount = neighboringRouters.size();
617  for (long i = 0; i < neighborCount; i++) {
618  neighboringRouters[i]->ageTransmittedLSAList();
619  }
620 }

◆ changeState()

void inet::ospfv2::Ospfv2Interface::changeState ( Ospfv2InterfaceState newState,
Ospfv2InterfaceState currentState 
)
private
141 {
142  EV_INFO << "Changing the state of interface " << this->getIfIndex()
143  << " from '" << getStateString(currentState->getState())
144  << "' to '" << getStateString(newState->getState()) << "'" << std::endl;
145 
146  if (previousState != nullptr) {
147  delete previousState;
148  }
149  state = newState;
150  previousState = currentState;
151 }

Referenced by inet::ospfv2::Ospfv2InterfaceState::changeState().

◆ createUpdatePacket()

Packet * inet::ospfv2::Ospfv2Interface::createUpdatePacket ( const Ospfv2Lsa lsa)
473 {
474  Ospfv2LsaType lsaType = lsa->getHeader().getLsType();
475  const auto& updatePacket = makeShared<Ospfv2LinkStateUpdatePacket>();
476  B packetLength = OSPFv2_HEADER_LENGTH + B(sizeof(uint32_t)); // OSPF header + place for number of advertisements
477 
478  updatePacket->setType(LINKSTATE_UPDATE_PACKET);
479  updatePacket->setRouterID(Ipv4Address(parentArea->getRouter()->getRouterID()));
480  updatePacket->setAreaID(Ipv4Address(areaID));
481  updatePacket->setAuthenticationType(authenticationType);
482 
483  switch (lsaType) {
484  case ROUTERLSA_TYPE:
485  case NETWORKLSA_TYPE:
488  case AS_EXTERNAL_LSA_TYPE: {
489  updatePacket->setOspfLSAsArraySize(1);
490  updatePacket->setOspfLSAs(0, lsa->dup());
491  auto lsa = updatePacket->getOspfLSAsForUpdate(0);
492  auto& lsaHeader = lsa->getHeaderForUpdate();
493  unsigned short lsAge = lsaHeader.getLsAge();
494  if (lsAge < MAX_AGE - interfaceTransmissionDelay) {
496  }
497  else {
498  lsAge = MAX_AGE;
499  }
500  lsaHeader.setLsAge(lsAge);
501  auto lsaSize = calculateLSASize(lsa);
502  ASSERT(lsaSize == B(lsaHeader.getLsaLength()));
503  setLsaCrc(*lsa, crcMode);
504  packetLength += lsaSize;
505  }
506  break;
507 
508  default:
509  throw cRuntimeError("Invalid LSA type: %d", lsaType);
510  }
511 
512  updatePacket->setPacketLengthField(B(packetLength).get());
513  updatePacket->setChunkLength(packetLength);
514 
515  for (int j = 0; j < 8; j++) {
516  updatePacket->setAuthentication(j, authenticationKey.bytes[j]);
517  }
518 
519  setOspfCrc(updatePacket, crcMode);
520 
521  Packet *pk = new Packet();
522  pk->insertAtBack(updatePacket);
523 
524  return pk;
525 }

Referenced by floodLsa(), inet::ospfv2::LinkStateRequestHandler::processPacket(), and inet::ospfv2::LinkStateUpdateHandler::processPacket().

◆ floodLsa()

bool inet::ospfv2::Ospfv2Interface::floodLsa ( const Ospfv2Lsa lsa,
Ospfv2Interface intf = nullptr,
Neighbor neighbor = nullptr 
)
See also
RFC2328 Section 13.3.
340 {
341  bool floodedBackOut = false;
342 
343  if (
344  (
345  (lsa->getHeader().getLsType() == AS_EXTERNAL_LSA_TYPE) &&
348  ) ||
349  (
350  (lsa->getHeader().getLsType() != AS_EXTERNAL_LSA_TYPE) &&
351  (
352  (
353  (areaID != BACKBONE_AREAID) &&
355  ) ||
357  )
358  )
359  )
360  {
361  long neighborCount = neighboringRouters.size();
362  bool lsaAddedToRetransmissionList = false;
363  LinkStateId linkStateID = lsa->getHeader().getLinkStateID();
364  LsaKeyType lsaKey;
365 
366  lsaKey.linkStateID = linkStateID;
367  lsaKey.advertisingRouter = lsa->getHeader().getAdvertisingRouter();
368 
369  for (long i = 0; i < neighborCount; i++) { // (1)
370  if (neighboringRouters[i]->getState() < Neighbor::EXCHANGE_STATE) { // (1) (a)
371  continue;
372  }
373  if (neighboringRouters[i]->getState() < Neighbor::FULL_STATE) { // (1) (b)
374  Ospfv2LsaHeader *requestLSAHeader = neighboringRouters[i]->findOnRequestList(lsaKey);
375  if (requestLSAHeader != nullptr) {
376  // operator< and operator== on OSPFLSAHeaders determines which one is newer(less means older)
377  if (lsa->getHeader() < (*requestLSAHeader)) {
378  continue;
379  }
380  if (operator==(lsa->getHeader(), (*requestLSAHeader))) {
381  neighboringRouters[i]->removeFromRequestList(lsaKey);
382  continue;
383  }
384  neighboringRouters[i]->removeFromRequestList(lsaKey);
385  }
386  }
387  if (neighbor == neighboringRouters[i]) { // (1) (c)
388  continue;
389  }
390  neighboringRouters[i]->addToRetransmissionList(lsa); // (1) (d)
391  lsaAddedToRetransmissionList = true;
392  }
393  if (lsaAddedToRetransmissionList) { // (2)
394  if ((intf != this) ||
395  ((neighbor != nullptr) &&
396  (neighbor->getNeighborID() != designatedRouter.routerID) &&
397  (neighbor->getNeighborID() != backupDesignatedRouter.routerID))) // (3)
398  {
399  if ((intf != this) || (getState() != Ospfv2Interface::BACKUP_STATE)) { // (4)
400  Packet *updatePacket = createUpdatePacket(lsa); // (5)
401 
402  if (updatePacket != nullptr) {
404  MessageHandler *messageHandler = parentArea->getRouter()->getMessageHandler();
405 
410  {
411  messageHandler->sendPacket(updatePacket, Ipv4Address::ALL_OSPF_ROUTERS_MCAST, this, ttl);
412  for (long k = 0; k < neighborCount; k++) {
413  neighboringRouters[k]->addToTransmittedLSAList(lsaKey);
414  if (!neighboringRouters[k]->isUpdateRetransmissionTimerActive()) {
415  neighboringRouters[k]->startUpdateRetransmissionTimer();
416  }
417  }
418  }
419  else {
420  messageHandler->sendPacket(updatePacket, Ipv4Address::ALL_OSPF_DESIGNATED_ROUTERS_MCAST, this, ttl);
421  Neighbor *dRouter = getNeighborById(designatedRouter.routerID);
422  Neighbor *backupDRouter = getNeighborById(backupDesignatedRouter.routerID);
423  if (dRouter != nullptr) {
424  dRouter->addToTransmittedLSAList(lsaKey);
425  if (!dRouter->isUpdateRetransmissionTimerActive()) {
426  dRouter->startUpdateRetransmissionTimer();
427  }
428  }
429  if (backupDRouter != nullptr) {
430  backupDRouter->addToTransmittedLSAList(lsaKey);
431  if (!backupDRouter->isUpdateRetransmissionTimerActive()) {
432  backupDRouter->startUpdateRetransmissionTimer();
433  }
434  }
435  }
436  }
437  else {
439  messageHandler->sendPacket(updatePacket, Ipv4Address::ALL_OSPF_ROUTERS_MCAST, this, ttl);
440  if (neighborCount > 0) {
441  neighboringRouters[0]->addToTransmittedLSAList(lsaKey);
442  if (!neighboringRouters[0]->isUpdateRetransmissionTimerActive()) {
443  neighboringRouters[0]->startUpdateRetransmissionTimer();
444  }
445  }
446  }
447  else {
448  for (long m = 0; m < neighborCount; m++) {
450  messageHandler->sendPacket(updatePacket, neighboringRouters[m]->getAddress(), this, ttl);
451  neighboringRouters[m]->addToTransmittedLSAList(lsaKey);
452  if (!neighboringRouters[m]->isUpdateRetransmissionTimerActive()) {
453  neighboringRouters[m]->startUpdateRetransmissionTimer();
454  }
455  }
456  }
457  }
458  }
459 
460  if (intf == this) {
461  floodedBackOut = true;
462  }
463  }
464  }
465  }
466  }
467  }
468 
469  return floodedBackOut;
470 }

◆ getAcknowledgementDelay()

short inet::ospfv2::Ospfv2Interface::getAcknowledgementDelay ( ) const
inline

◆ getAcknowledgementTimer()

cMessage* inet::ospfv2::Ospfv2Interface::getAcknowledgementTimer ( )
inline

◆ getAddressRange()

◆ getArea() [1/2]

Ospfv2Area* inet::ospfv2::Ospfv2Interface::getArea ( )
inline
179 { return parentArea; }

Referenced by inet::ospfv2::LinkStateUpdateHandler::acknowledgeLSA(), inet::ospfv2::Ospfv2InterfaceState::changeState(), inet::ospfv2::NeighborState::changeState(), inet::ospfv2::Neighbor::clearRequestRetransmissionTimer(), inet::ospfv2::Neighbor::clearUpdateRetransmissionTimer(), inet::ospfv2::Neighbor::createDatabaseSummary(), inet::ospfv2::Neighbor::needAdjacency(), inet::ospfv2::DatabaseDescriptionHandler::processDDPacket(), inet::ospfv2::NeighborStateExchangeStart::processEvent(), inet::ospfv2::InterfaceStateDown::processEvent(), inet::ospfv2::NeighborStateLoading::processEvent(), inet::ospfv2::InterfaceStateNotDesignatedRouter::processEvent(), inet::ospfv2::InterfaceStateWaiting::processEvent(), inet::ospfv2::NeighborStateInit::processEvent(), inet::ospfv2::InterfaceStatePointToPoint::processEvent(), inet::ospfv2::NeighborStateTwoWay::processEvent(), inet::ospfv2::InterfaceStateBackup::processEvent(), inet::ospfv2::NeighborStateAttempt::processEvent(), inet::ospfv2::NeighborStateDown::processEvent(), inet::ospfv2::NeighborStateFull::processEvent(), inet::ospfv2::InterfaceStateDesignatedRouter::processEvent(), inet::ospfv2::NeighborStateExchange::processEvent(), inet::ospfv2::HelloHandler::processPacket(), inet::ospfv2::LinkStateRequestHandler::processPacket(), inet::ospfv2::Neighbor::reset(), inet::ospfv2::Neighbor::retransmitDatabaseDescriptionPacket(), inet::ospfv2::Neighbor::retransmitUpdatePacket(), inet::ospfv2::Neighbor::sendDatabaseDescriptionPacket(), inet::ospfv2::Neighbor::sendLinkStateRequestPacket(), inet::ospfv2::Neighbor::startRequestRetransmissionTimer(), inet::ospfv2::Neighbor::startUpdateRetransmissionTimer(), inet::ospfv2::NeighborState::updateLsa(), and inet::ospfv2::Neighbor::~Neighbor().

◆ getArea() [2/2]

const Ospfv2Area* inet::ospfv2::Ospfv2Interface::getArea ( ) const
inline
180 { return parentArea; }

◆ getAreaId()

AreaId inet::ospfv2::Ospfv2Interface::getAreaId ( ) const
inline

◆ getAuthenticationKey()

◆ getAuthenticationType()

◆ getBackupDesignatedRouter()

DesignatedRouterId inet::ospfv2::Ospfv2Interface::getBackupDesignatedRouter ( ) const
inline

◆ getCrcMode()

◆ getDesignatedRouter()

◆ getHelloInterval()

◆ getHelloTimer()

◆ getIfIndex()

◆ getInterfaceName()

std::string inet::ospfv2::Ospfv2Interface::getInterfaceName ( ) const
inline
139 { return interfaceName; }

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

◆ getMode()

Ospfv2InterfaceMode inet::ospfv2::Ospfv2Interface::getMode ( ) const
inline

◆ getModeString()

const char * inet::ospfv2::Ospfv2Interface::getModeString ( Ospfv2InterfaceMode  intfMode)
static
111 {
112  switch (intfMode) {
113  case ACTIVE:
114  return "Active";
115 
116  case PASSIVE:
117  return "Passive";
118 
119  case NO_OSPF:
120  return "NoOSPF";
121 
122  default:
123  ASSERT(false);
124  break;
125  }
126  return "";
127 }

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

◆ getMtu()

◆ getNeighbor() [1/2]

◆ getNeighbor() [2/2]

const Neighbor* inet::ospfv2::Ospfv2Interface::getNeighbor ( unsigned long  i) const
inline
176 { return neighboringRouters[i]; }

◆ getNeighborByAddress()

Neighbor * inet::ospfv2::Ospfv2Interface::getNeighborByAddress ( Ipv4Address  address)
262 {
263  auto neighborIt = neighboringRoutersByAddress.find(address);
264  return (neighborIt != neighboringRoutersByAddress.end()) ? neighborIt->second : nullptr;
265 }

Referenced by inet::ospfv2::Ospfv2Area::originateRouterLSA(), inet::ospfv2::HelloHandler::processPacket(), and inet::ospfv2::MessageHandler::processPacket().

◆ getNeighborById()

Neighbor * inet::ospfv2::Ospfv2Interface::getNeighborById ( RouterId  neighborID)

◆ getNeighborCount()

◆ getOutputCost()

Metric inet::ospfv2::Ospfv2Interface::getOutputCost ( ) const
inline

◆ getPollInterval()

◆ getRetransmissionInterval()

◆ getRouterDeadInterval()

short inet::ospfv2::Ospfv2Interface::getRouterDeadInterval ( ) const
inline

◆ getRouterPriority()

unsigned char inet::ospfv2::Ospfv2Interface::getRouterPriority ( ) const
inline

◆ getState()

◆ getStateString()

const char * inet::ospfv2::Ospfv2Interface::getStateString ( Ospfv2Interface::Ospfv2InterfaceStateType  stateType)
static
281 {
282  switch (stateType) {
283  case DOWN_STATE:
284  return "Down";
285 
286  case LOOPBACK_STATE:
287  return "Loopback";
288 
289  case WAITING_STATE:
290  return "Waiting";
291 
292  case POINTTOPOINT_STATE:
293  return "PointToPoint";
294 
296  return "NotDesignatedRouter";
297 
298  case BACKUP_STATE:
299  return "Backup";
300 
302  return "DesignatedRouter";
303 
304  default:
305  ASSERT(false);
306  break;
307  }
308  return "";
309 }

Referenced by changeState(), inet::ospfv2::operator<<(), inet::ospfv2::Ospfv2InterfaceState::printElectionResult(), and inet::ospfv2::MessageHandler::printEvent().

◆ getTransitAreaId()

◆ getTransmissionDelay()

short inet::ospfv2::Ospfv2Interface::getTransmissionDelay ( ) const
inline

◆ getType()

Ospfv2InterfaceType inet::ospfv2::Ospfv2Interface::getType ( ) const
inline
129 { return interfaceType; }

Referenced by inet::ospfv2::LinkStateUpdateHandler::acknowledgeLSA(), inet::ospfv2::Ospfv2InterfaceState::changeState(), inet::ospfv2::Neighbor::createDatabaseSummary(), inet::ospfv2::Neighbor::needAdjacency(), inet::ospfv2::Ospfv2Area::originateRouterLSA(), inet::ospfv2::Ospfv2InterfaceState::printElectionResult(), inet::ospfv2::MessageHandler::printEvent(), inet::ospfv2::NeighborStateDown::processEvent(), inet::ospfv2::NeighborStateAttempt::processEvent(), inet::ospfv2::NeighborStateExchangeStart::processEvent(), inet::ospfv2::NeighborStateInit::processEvent(), inet::ospfv2::NeighborStateTwoWay::processEvent(), inet::ospfv2::NeighborStateLoading::processEvent(), inet::ospfv2::InterfaceStateBackup::processEvent(), inet::ospfv2::InterfaceStateDesignatedRouter::processEvent(), inet::ospfv2::InterfaceStateWaiting::processEvent(), inet::ospfv2::InterfaceStatePointToPoint::processEvent(), inet::ospfv2::InterfaceStateNotDesignatedRouter::processEvent(), inet::ospfv2::InterfaceStateDown::processEvent(), inet::ospfv2::NeighborStateExchange::processEvent(), inet::ospfv2::NeighborStateFull::processEvent(), inet::ospfv2::LinkStateRequestHandler::processPacket(), inet::ospfv2::HelloHandler::processPacket(), inet::ospfv2::LinkStateUpdateHandler::processPacket(), inet::ospfv2::MessageHandler::processPacket(), inet::ospfv2::Neighbor::retransmitDatabaseDescriptionPacket(), inet::ospfv2::Neighbor::retransmitUpdatePacket(), inet::ospfv2::Neighbor::sendDatabaseDescriptionPacket(), and inet::ospfv2::Neighbor::sendLinkStateRequestPacket().

◆ getTypeString()

const char * inet::ospfv2::Ospfv2Interface::getTypeString ( Ospfv2InterfaceType  intfType)
static
83 {
84  switch (intfType) {
85  case UNKNOWN_TYPE:
86  return "Unknown";
87 
88  case POINTTOPOINT:
89  return "PointToPoint";
90 
91  case BROADCAST:
92  return "Broadcast";
93 
94  case NBMA:
95  return "NBMA";
96 
97  case POINTTOMULTIPOINT:
98  return "PointToMultiPoint";
99 
100  case VIRTUAL:
101  return "Virtual";
102 
103  default:
104  ASSERT(false);
105  break;
106  }
107  return "";
108 }

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

◆ getWaitTimer()

cMessage* inet::ospfv2::Ospfv2Interface::getWaitTimer ( )
inline

◆ hasAnyNeighborInStates()

bool inet::ospfv2::Ospfv2Interface::hasAnyNeighborInStates ( int  states) const
312 {
313  for (uint32_t i = 0; i < neighboringRouters.size(); i++) {
314  Neighbor::NeighborStateType neighborState = neighboringRouters[i]->getState();
315  if (neighborState & states)
316  return true;
317  }
318  return false;
319 }

Referenced by inet::ospfv2::Ospfv2Area::ageDatabase(), inet::ospfv2::Ospfv2Area::originateNetworkLSA(), and inet::ospfv2::Ospfv2Area::originateRouterLSA().

◆ isOnAnyRetransmissionList()

bool inet::ospfv2::Ospfv2Interface::isOnAnyRetransmissionList ( LsaKeyType  lsaKey) const
328 {
329  for (uint32_t i = 0; i < neighboringRouters.size(); i++) {
330  if (neighboringRouters[i]->isLinkStateRequestListEmpty(lsaKey))
331  return true;
332  }
333  return false;
334 }

◆ processEvent()

◆ removeFromAllRetransmissionLists()

void inet::ospfv2::Ospfv2Interface::removeFromAllRetransmissionLists ( LsaKeyType  lsaKey)
322 {
323  for (uint32_t i = 0; i < neighboringRouters.size(); i++)
324  neighboringRouters[i]->removeFromRetransmissionList(lsaKey);
325 }

◆ reset()

◆ sendDelayedAcknowledgements()

void inet::ospfv2::Ospfv2Interface::sendDelayedAcknowledgements ( )
551 {
552  MessageHandler *messageHandler = parentArea->getRouter()->getMessageHandler();
554 
555  for (auto& elem : delayedAcknowledgements) {
556  int ackCount = elem.second.size();
557  if (ackCount > 0) {
558  while (!(elem.second.empty())) {
559  const auto& ackPacket = makeShared<Ospfv2LinkStateAcknowledgementPacket>();
561 
562  ackPacket->setType(LINKSTATE_ACKNOWLEDGEMENT_PACKET);
563  ackPacket->setRouterID(Ipv4Address(parentArea->getRouter()->getRouterID()));
564  ackPacket->setAreaID(Ipv4Address(areaID));
565  ackPacket->setAuthenticationType(authenticationType);
566 
567  while ((!(elem.second.empty())) && (packetSize <= (maxPacketSize - OSPFv2_LSA_HEADER_LENGTH))) {
568  unsigned long headerCount = ackPacket->getLsaHeadersArraySize();
569  ackPacket->setLsaHeadersArraySize(headerCount + 1);
570  ackPacket->setLsaHeaders(headerCount, *(elem.second.begin()));
571  elem.second.pop_front();
572  packetSize += OSPFv2_LSA_HEADER_LENGTH;
573  }
574 
575  ackPacket->setPacketLengthField(B(packetSize - IPv4_MAX_HEADER_LENGTH).get());
576  ackPacket->setChunkLength(B(ackPacket->getPacketLengthField()));
577 
578  for (int i = 0; i < 8; i++) {
579  ackPacket->setAuthentication(i, authenticationKey.bytes[i]);
580  }
581 
582  setOspfCrc(ackPacket, crcMode);
583 
584  Packet *pk = new Packet();
585  pk->insertAtBack(ackPacket);
586 
588 
593  {
594  messageHandler->sendPacket(pk, Ipv4Address::ALL_OSPF_ROUTERS_MCAST, this, ttl);
595  }
596  else {
597  messageHandler->sendPacket(pk, Ipv4Address::ALL_OSPF_DESIGNATED_ROUTERS_MCAST, this, ttl);
598  }
599  }
600  else {
602  messageHandler->sendPacket(pk, Ipv4Address::ALL_OSPF_ROUTERS_MCAST, this, ttl);
603  }
604  else {
605  messageHandler->sendPacket(pk, elem.first, this, ttl);
606  }
607  }
608  }
609  }
610  }
611  messageHandler->startTimer(acknowledgementTimer, acknowledgementDelay);
612 }

Referenced by inet::ospfv2::InterfaceStateBackup::processEvent(), inet::ospfv2::InterfaceStateWaiting::processEvent(), inet::ospfv2::InterfaceStatePointToPoint::processEvent(), inet::ospfv2::InterfaceStateNotDesignatedRouter::processEvent(), and inet::ospfv2::InterfaceStateDesignatedRouter::processEvent().

◆ sendHelloPacket()

void inet::ospfv2::Ospfv2Interface::sendHelloPacket ( Ipv4Address  destination,
short  ttl = 1 
)
173 {
174  const auto& helloPacket = makeShared<Ospfv2HelloPacket>();
175  std::vector<Ipv4Address> neighbors;
176 
177  helloPacket->setRouterID(Ipv4Address(parentArea->getRouter()->getRouterID()));
178  helloPacket->setAreaID(Ipv4Address(parentArea->getAreaID()));
179  helloPacket->setAuthenticationType(authenticationType);
180 
181  if (((interfaceType == POINTTOPOINT) &&
183  (interfaceType == VIRTUAL))
184  {
185  helloPacket->setNetworkMask(NULL_IPV4ADDRESS);
186  }
187  else {
188  helloPacket->setNetworkMask(interfaceAddressRange.mask);
189  }
190 
191  Ospfv2Options options;
192  options.E_ExternalRoutingCapability = parentArea->getExternalRoutingCapability();
193  helloPacket->setOptions(options);
194  helloPacket->setHelloInterval(helloInterval);
195  helloPacket->setRouterPriority(routerPriority);
196  helloPacket->setRouterDeadInterval(routerDeadInterval);
197  helloPacket->setDesignatedRouter(designatedRouter.ipInterfaceAddress);
198  helloPacket->setBackupDesignatedRouter(backupDesignatedRouter.ipInterfaceAddress);
199  long neighborCount = neighboringRouters.size();
200  for (long j = 0; j < neighborCount; j++) {
202  neighbors.push_back(neighboringRouters[j]->getAddress());
203  }
204  }
205  unsigned int initedNeighborCount = neighbors.size();
206  helloPacket->setNeighborArraySize(initedNeighborCount);
207  for (unsigned int k = 0; k < initedNeighborCount; k++) {
208  helloPacket->setNeighbor(k, neighbors[k]);
209  }
210 
211  helloPacket->setPacketLengthField(B(OSPFv2_HEADER_LENGTH + OSPFv2_HELLO_HEADER_LENGTH + B(initedNeighborCount * 4)).get());
212  helloPacket->setChunkLength(B(helloPacket->getPacketLengthField()));
213 
214  for (int i = 0; i < 8; i++) {
215  helloPacket->setAuthentication(i, authenticationKey.bytes[i]);
216  }
217 
218  setOspfCrc(helloPacket, crcMode);
219 
220  Packet *pk = new Packet();
221  pk->insertAtBack(helloPacket);
222 
223  parentArea->getRouter()->getMessageHandler()->sendPacket(pk, destination, this, ttl);
224 }

Referenced by inet::ospfv2::InterfaceStateBackup::processEvent(), inet::ospfv2::NeighborStateDown::processEvent(), inet::ospfv2::InterfaceStateWaiting::processEvent(), inet::ospfv2::InterfaceStatePointToPoint::processEvent(), inet::ospfv2::InterfaceStateNotDesignatedRouter::processEvent(), inet::ospfv2::InterfaceStateDesignatedRouter::processEvent(), and inet::ospfv2::HelloHandler::processPacket().

◆ sendLsAcknowledgement()

void inet::ospfv2::Ospfv2Interface::sendLsAcknowledgement ( const Ospfv2LsaHeader lsaHeader,
Ipv4Address  destination 
)
227 {
228  Ospfv2Options options;
229  const auto& lsAckPacket = makeShared<Ospfv2LinkStateAcknowledgementPacket>();
230 
231  lsAckPacket->setType(LINKSTATE_ACKNOWLEDGEMENT_PACKET);
232  lsAckPacket->setRouterID(Ipv4Address(parentArea->getRouter()->getRouterID()));
233  lsAckPacket->setAreaID(Ipv4Address(parentArea->getAreaID()));
234  lsAckPacket->setAuthenticationType(authenticationType);
235 
236  lsAckPacket->setLsaHeadersArraySize(1);
237  lsAckPacket->setLsaHeaders(0, *lsaHeader);
238 
239  lsAckPacket->setPacketLengthField(B(OSPFv2_HEADER_LENGTH + OSPFv2_LSA_HEADER_LENGTH).get());
240  lsAckPacket->setChunkLength(B(lsAckPacket->getPacketLengthField()));
241 
242  for (int i = 0; i < 8; i++) {
243  lsAckPacket->setAuthentication(i, authenticationKey.bytes[i]);
244  }
245 
246  setOspfCrc(lsAckPacket, crcMode);
247 
248  Packet *pk = new Packet();
249  pk->insertAtBack(lsAckPacket);
250 
252  parentArea->getRouter()->getMessageHandler()->sendPacket(pk, destination, this, ttl);
253 }

Referenced by inet::ospfv2::LinkStateUpdateHandler::processPacket().

◆ setAcknowledgementDelay()

void inet::ospfv2::Ospfv2Interface::setAcknowledgementDelay ( short  delay)
inline
152 { acknowledgementDelay = delay; }

◆ setAddressRange()

void inet::ospfv2::Ospfv2Interface::setAddressRange ( Ipv4AddressRange  range)
inline

◆ setArea()

void inet::ospfv2::Ospfv2Interface::setArea ( Ospfv2Area area)
inline
178 { parentArea = area; }

Referenced by inet::ospfv2::Ospfv2Area::addInterface().

◆ setAreaId()

void inet::ospfv2::Ospfv2Interface::setAreaId ( AreaId  areaId)
inline

◆ setAuthenticationKey()

void inet::ospfv2::Ospfv2Interface::setAuthenticationKey ( AuthenticationKeyType  key)
inline

◆ setAuthenticationType()

void inet::ospfv2::Ospfv2Interface::setAuthenticationType ( AuthenticationType  type)
inline

◆ setCrcMode()

void inet::ospfv2::Ospfv2Interface::setCrcMode ( CrcMode  crcMode)
inline

◆ setHelloInterval()

void inet::ospfv2::Ospfv2Interface::setHelloInterval ( short  interval)
inline

◆ setIfIndex()

void inet::ospfv2::Ospfv2Interface::setIfIndex ( IInterfaceTable ift,
int  index 
)
130 {
131  ifIndex = index;
133  NetworkInterface *routingInterface = ift->getInterfaceById(ifIndex);
134  interfaceAddressRange.address = routingInterface->getProtocolData<Ipv4InterfaceData>()->getIPAddress();
135  interfaceAddressRange.mask = routingInterface->getProtocolData<Ipv4InterfaceData>()->getNetmask();
136  mtu = routingInterface->getMtu();
137  }
138 }

Referenced by inet::ospfv2::Ospfv2Area::calculateShortestPathTree(), and inet::ospfv2::Ospfv2ConfigReader::loadInterfaceParameters().

◆ setInterfaceName()

void inet::ospfv2::Ospfv2Interface::setInterfaceName ( std::string  ifName)
inline

◆ setMode()

void inet::ospfv2::Ospfv2Interface::setMode ( Ospfv2InterfaceMode  intfMode)
inline

◆ setMtu()

void inet::ospfv2::Ospfv2Interface::setMtu ( unsigned short  ifMTU)
inline
140 { mtu = ifMTU; }

◆ setOutputCost()

void inet::ospfv2::Ospfv2Interface::setOutputCost ( Metric  cost)
inline

◆ setPollInterval()

void inet::ospfv2::Ospfv2Interface::setPollInterval ( short  interval)
inline

◆ setRetransmissionInterval()

void inet::ospfv2::Ospfv2Interface::setRetransmissionInterval ( short  interval)
inline

◆ setRouterDeadInterval()

void inet::ospfv2::Ospfv2Interface::setRouterDeadInterval ( short  interval)
inline

◆ setRouterPriority()

void inet::ospfv2::Ospfv2Interface::setRouterPriority ( unsigned char  priority)
inline

◆ setTransitAreaId()

void inet::ospfv2::Ospfv2Interface::setTransitAreaId ( AreaId  areaId)
inline

◆ setTransmissionDelay()

void inet::ospfv2::Ospfv2Interface::setTransmissionDelay ( short  delay)
inline

◆ setType()

void inet::ospfv2::Ospfv2Interface::setType ( Ospfv2InterfaceType  ifType)
inline

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  stream,
const Ospfv2Interface intf 
)
friend
623 {
624  std::string neighbors = "";
625  for (auto& neighbor : intf.neighboringRoutersByID) {
626  std::string neighborState = Neighbor::getStateString((neighbor.second)->getState());
627  neighbors = neighbors + (neighbor.first).str() + "(" + neighborState + ") ";
628  }
629 
630  return stream << "name: " << intf.getInterfaceName() << " "
631  << "index: " << intf.ifIndex << " "
632  << "type: '" << intf.getTypeString(intf.interfaceType) << "' "
633  << "MTU: " << intf.mtu << " "
634  << "state: '" << intf.getStateString(intf.state->getState()) << "' "
635  << "mode: '" << intf.getModeString(intf.interfaceMode) << "' "
636  << "cost: " << intf.interfaceOutputCost << " "
637 
638  << "area: " << intf.areaID.str(false) << " "
639  << "transitArea: " << intf.transitAreaID.str(false) << " "
640 
641  << "helloInterval: " << intf.helloInterval << " "
642  << "pollInterval: " << intf.pollInterval << " "
643  << "routerDeadInterval: " << intf.routerDeadInterval << " "
644  << "retransmissionInterval: " << intf.retransmissionInterval << " "
645 
646  << "acknowledgementDelay: " << intf.acknowledgementDelay << " "
647  << "interfaceTransmissionDelay: " << intf.interfaceTransmissionDelay << " "
648 
649  << "neighboringRouters: " << ((neighbors == "") ? "<none>(down)" : neighbors) << " "
650 
651  << "routerPriority: " << (int)(intf.routerPriority) << " "
652  << "designatedRouterID: " << intf.designatedRouter.routerID << " "
653  << "designatedRouterInterface: " << intf.designatedRouter.ipInterfaceAddress << " "
654  << "backupDesignatedRouterID: " << intf.backupDesignatedRouter.routerID << " "
655  << "backupDesignatedRouterInterface: " << intf.backupDesignatedRouter.ipInterfaceAddress;
656 }

◆ Ospfv2InterfaceState

friend class Ospfv2InterfaceState
friend

Member Data Documentation

◆ acknowledgementDelay

short inet::ospfv2::Ospfv2Interface::acknowledgementDelay
private

◆ acknowledgementTimer

cMessage* inet::ospfv2::Ospfv2Interface::acknowledgementTimer
private

◆ areaID

AreaId inet::ospfv2::Ospfv2Interface::areaID
private

◆ authenticationKey

AuthenticationKeyType inet::ospfv2::Ospfv2Interface::authenticationKey
private

◆ authenticationType

AuthenticationType inet::ospfv2::Ospfv2Interface::authenticationType
private

◆ backupDesignatedRouter

◆ crcMode

CrcMode inet::ospfv2::Ospfv2Interface::crcMode
private

◆ delayedAcknowledgements

std::map<Ipv4Address, std::list<Ospfv2LsaHeader> > inet::ospfv2::Ospfv2Interface::delayedAcknowledgements
private

◆ designatedRouter

◆ helloInterval

short inet::ospfv2::Ospfv2Interface::helloInterval
private

◆ helloTimer

cMessage* inet::ospfv2::Ospfv2Interface::helloTimer
private

◆ ifIndex

int inet::ospfv2::Ospfv2Interface::ifIndex
private

◆ interfaceAddressRange

Ipv4AddressRange inet::ospfv2::Ospfv2Interface::interfaceAddressRange
private

◆ interfaceMode

Ospfv2InterfaceMode inet::ospfv2::Ospfv2Interface::interfaceMode
private

◆ interfaceName

std::string inet::ospfv2::Ospfv2Interface::interfaceName
private

◆ interfaceOutputCost

Metric inet::ospfv2::Ospfv2Interface::interfaceOutputCost
private

◆ interfaceTransmissionDelay

short inet::ospfv2::Ospfv2Interface::interfaceTransmissionDelay
private

◆ interfaceType

◆ mtu

unsigned short inet::ospfv2::Ospfv2Interface::mtu
private

◆ neighboringRouters

◆ neighboringRoutersByAddress

std::map<Ipv4Address, Neighbor *> inet::ospfv2::Ospfv2Interface::neighboringRoutersByAddress
private

◆ neighboringRoutersByID

std::map<RouterId, Neighbor *> inet::ospfv2::Ospfv2Interface::neighboringRoutersByID
private

◆ parentArea

◆ pollInterval

short inet::ospfv2::Ospfv2Interface::pollInterval
private

◆ previousState

Ospfv2InterfaceState* inet::ospfv2::Ospfv2Interface::previousState
private

◆ retransmissionInterval

short inet::ospfv2::Ospfv2Interface::retransmissionInterval
private

◆ routerDeadInterval

short inet::ospfv2::Ospfv2Interface::routerDeadInterval
private

◆ routerPriority

unsigned char inet::ospfv2::Ospfv2Interface::routerPriority
private

◆ state

◆ transitAreaID

AreaId inet::ospfv2::Ospfv2Interface::transitAreaID
private

◆ waitTimer

cMessage* inet::ospfv2::Ospfv2Interface::waitTimer
private

The documentation for this class was generated from the following files:
inet::ospfv2::Neighbor::INIT_STATE
@ INIT_STATE
Definition: Ospfv2Neighbor.h:52
VIRTUAL_LINK_TTL
#define VIRTUAL_LINK_TTL
Definition: Ospfv2Common.h:36
inet::ospfv2::Ospfv2Interface::routerDeadInterval
short routerDeadInterval
Definition: Ospfv2Interface.h:81
inet::ospfv2::Neighbor::FULL_STATE
@ FULL_STATE
Definition: Ospfv2Neighbor.h:57
inet::ospfv2::Ospfv2Interface::ifIndex
int ifIndex
Definition: Ospfv2Interface.h:74
inet::ospfv2::Ospfv2Interface::authenticationType
AuthenticationType authenticationType
Definition: Ospfv2Interface.h:96
inet::ospfv2::Ospfv2Interface::transitAreaID
AreaId transitAreaID
Definition: Ospfv2Interface.h:78
inet::ospfv2::Ospfv2Interface::crcMode
CrcMode crcMode
Definition: Ospfv2Interface.h:70
inet::ospf::LINKSTATE_ACKNOWLEDGEMENT_PACKET
@ LINKSTATE_ACKNOWLEDGEMENT_PACKET
Definition: OspfPacketBase_m.h:69
inet::ospfv2::Ospfv2Interface::POINTTOPOINT
@ POINTTOPOINT
Definition: Ospfv2Interface.h:32
inet::ospfv2::Neighbor::NeighborStateType
NeighborStateType
Definition: Ospfv2Neighbor.h:49
inet::ospfv2::Ospfv2Interface::previousState
Ospfv2InterfaceState * previousState
Definition: Ospfv2Interface.h:72
inet::ospfv2::INTERFACE_HELLO_TIMER
@ INTERFACE_HELLO_TIMER
Definition: Ospfv2Packet_m.h:93
inet::ospfv2::Ospfv2Interface::acknowledgementTimer
cMessage * acknowledgementTimer
Definition: Ospfv2Interface.h:86
inet::ospfv2::Ospfv2Interface::WAITING_STATE
@ WAITING_STATE
Definition: Ospfv2Interface.h:54
inet::ospfv2::Ospfv2Interface::parentArea
Ospfv2Area * parentArea
Definition: Ospfv2Interface.h:99
inet::ospfv2::Ospfv2Interface::WAIT_TIMER
@ WAIT_TIMER
Definition: Ospfv2Interface.h:42
inet::ospfv2::Ospfv2Interface::routerPriority
unsigned char routerPriority
Definition: Ospfv2Interface.h:83
inet::ospfv2::SUMMARYLSA_NETWORKS_TYPE
@ SUMMARYLSA_NETWORKS_TYPE
Definition: Ospfv2Packet_m.h:285
inet::ospfv2::Ospfv2Interface::designatedRouter
DesignatedRouterId designatedRouter
Definition: Ospfv2Interface.h:91
inet::ospfv2::calculateLSASize
B calculateLSASize(const Ospfv2Lsa *lsa)
Definition: Lsa.cc:66
inet::ospfv2::Ospfv2Interface::pollInterval
short pollInterval
Definition: Ospfv2Interface.h:80
inet::ospfv2::Ospfv2Interface::INTERFACE_UP
@ INTERFACE_UP
Definition: Ospfv2Interface.h:40
inet::ospfv2::Ospfv2Interface::DESIGNATED_ROUTER_STATE
@ DESIGNATED_ROUTER_STATE
Definition: Ospfv2Interface.h:58
inet::ospfv2::setOspfCrc
void setOspfCrc(const Ptr< Ospfv2Packet > &ospfPacket, CrcMode crcMode)
Definition: Ospfv2Crc.cc:17
inet::ospfv2::IPV4_DATAGRAM_LENGTH
const B IPV4_DATAGRAM_LENGTH
Definition: Ospfv2Common.h:38
inet::ospfv2::Ospfv2LsaType
Ospfv2LsaType
Enum generated from inet/routing/ospfv2/Ospfv2Packet.msg:78 by opp_msgtool.
Definition: Ospfv2Packet_m.h:282
inet::ospfv2::Ospfv2Interface::NEIGHBOR_CHANGE
@ NEIGHBOR_CHANGE
Definition: Ospfv2Interface.h:45
inet::ospfv2::Ospfv2Interface::LOOP_INDICATION
@ LOOP_INDICATION
Definition: Ospfv2Interface.h:46
inet::ospfv2::Ospfv2Area::getExternalRoutingCapability
bool getExternalRoutingCapability() const
Definition: Ospfv2Area.h:61
inet::ospfv2::Neighbor::getStateString
static const char * getStateString(NeighborStateType stateType)
Definition: Ospfv2Neighbor.cc:132
inet::ospfv2::Router::getMessageHandler
MessageHandler * getMessageHandler()
Definition: Ospfv2Router.h:66
inet::ospfv2::NULL_IPV4ADDRESSRANGE
const Ipv4AddressRange NULL_IPV4ADDRESSRANGE(Ipv4Address(0, 0, 0, 0), Ipv4Address(0, 0, 0, 0))
inet::ospfv2::ROUTERLSA_TYPE
@ ROUTERLSA_TYPE
Definition: Ospfv2Packet_m.h:283
inet::ospfv2::Ospfv2Interface::UNKNOWN_TYPE
@ UNKNOWN_TYPE
Definition: Ospfv2Interface.h:31
inet::ospfv2::Ospfv2Interface::getNeighborById
Neighbor * getNeighborById(RouterId neighborID)
Definition: Ospfv2Interface.cc:255
MAX_AGE
#define MAX_AGE
Definition: Ospfv2Common.h:27
inet::CRC_MODE_UNDEFINED
@ CRC_MODE_UNDEFINED
Definition: CrcMode_m.h:55
inet::ospfv2::Ospfv2Interface::ACKNOWLEDGEMENT_TIMER
@ ACKNOWLEDGEMENT_TIMER
Definition: Ospfv2Interface.h:43
inet::ospfv2::NULL_IPV4ADDRESS
const Ipv4Address NULL_IPV4ADDRESS(0, 0, 0, 0)
inet::ospfv2::Ospfv2Interface::ACTIVE
@ ACTIVE
Definition: Ospfv2Interface.h:62
inet::ospf::LINKSTATE_UPDATE_PACKET
@ LINKSTATE_UPDATE_PACKET
Definition: OspfPacketBase_m.h:68
inet::ospfv2::NULL_TYPE
@ NULL_TYPE
Definition: Ospfv2Common.h:59
inet::ospfv2::NULL_DESIGNATEDROUTERID
const DesignatedRouterId NULL_DESIGNATEDROUTERID
Definition: Ospfv2Common.h:156
inet::ospfv2::Ipv4AddressRange::mask
Ipv4Address mask
Definition: Ospfv2Common.h:72
inet::ospfv2::Ospfv2Area::getAreaID
AreaId getAreaID() const
Definition: Ospfv2Area.h:53
inet::ospfv2::SUMMARYLSA_ASBOUNDARYROUTERS_TYPE
@ SUMMARYLSA_ASBOUNDARYROUTERS_TYPE
Definition: Ospfv2Packet_m.h:286
inet::ospfv2::Ospfv2Interface::waitTimer
cMessage * waitTimer
Definition: Ospfv2Interface.h:85
inet::ospfv2::Ospfv2Interface::neighboringRoutersByID
std::map< RouterId, Neighbor * > neighboringRoutersByID
Definition: Ospfv2Interface.h:87
inet::ospfv2::Ospfv2Interface::helloInterval
short helloInterval
Definition: Ospfv2Interface.h:79
inet::ospfv2::Ospfv2Interface::interfaceName
std::string interfaceName
Definition: Ospfv2Interface.h:73
inet::ospfv2::BACKBONE_AREAID
const AreaId BACKBONE_AREAID(0, 0, 0, 0)
inet::ospfv2::Ospfv2Interface::retransmissionInterval
short retransmissionInterval
Definition: Ospfv2Interface.h:94
inet::ospfv2::Ospfv2Interface::interfaceType
Ospfv2InterfaceType interfaceType
Definition: Ospfv2Interface.h:68
inet::units::units::B
intscale< b, 1, 8 > B
Definition: Units.h:1168
inet::ospfv2::Ospfv2Interface::helloTimer
cMessage * helloTimer
Definition: Ospfv2Interface.h:84
inet::ospfv2::Ospfv2Interface::BACKUP_SEEN
@ BACKUP_SEEN
Definition: Ospfv2Interface.h:44
inet::ospfv2::Ospfv2Interface::neighboringRouters
std::vector< Neighbor * > neighboringRouters
Definition: Ospfv2Interface.h:89
inet::ospfv2::Ospfv2Interface::VIRTUAL
@ VIRTUAL
Definition: Ospfv2Interface.h:36
inet::ospfv2::Ospfv2Area::getRouter
Router * getRouter()
Definition: Ospfv2Area.h:69
inet::ospfv2::AS_EXTERNAL_LSA_TYPE
@ AS_EXTERNAL_LSA_TYPE
Definition: Ospfv2Packet_m.h:287
inet::Ipv4Address::ALL_OSPF_DESIGNATED_ROUTERS_MCAST
static const Ipv4Address ALL_OSPF_DESIGNATED_ROUTERS_MCAST
224.0.0.6 All OSPF Designated Routers
Definition: Ipv4Address.h:100
inet::ospfv2::OSPFv2_LSA_HEADER_LENGTH
const B OSPFv2_LSA_HEADER_LENGTH
Definition: Ospfv2Common.h:40
inet::ospfv2::Ospfv2Interface::interfaceMode
Ospfv2InterfaceMode interfaceMode
Definition: Ospfv2Interface.h:69
inet::ospfv2::Ospfv2Interface::backupDesignatedRouter
DesignatedRouterId backupDesignatedRouter
Definition: Ospfv2Interface.h:92
inet::ospfv2::Ospfv2Interface::HELLO_TIMER
@ HELLO_TIMER
Definition: Ospfv2Interface.h:41
inet::ospfv2::Ospfv2Interface::INTERFACE_DOWN
@ INTERFACE_DOWN
Definition: Ospfv2Interface.h:48
type
removed type
Definition: IUdp-gates.txt:7
inet::ospfv2::INTERFACE_ACKNOWLEDGEMENT_TIMER
@ INTERFACE_ACKNOWLEDGEMENT_TIMER
Definition: Ospfv2Packet_m.h:95
inet::ospfv2::OSPFv2_HEADER_LENGTH
const B OSPFv2_HEADER_LENGTH
Definition: Ospfv2Common.h:39
inet::ospfv2::Ospfv2Interface::NBMA
@ NBMA
Definition: Ospfv2Interface.h:34
inet::ospfv2::Ospfv2InterfaceState::processEvent
virtual void processEvent(Ospfv2Interface *intf, Ospfv2Interface::Ospfv2InterfaceEventType event)=0
inet::ospfv2::LinkStateId
Ipv4Address LinkStateId
Definition: Ospfv2Common.h:131
inet::ospfv2::MessageHandler::sendPacket
void sendPacket(Packet *packet, Ipv4Address destination, Ospfv2Interface *outputIf, short ttl=1)
Definition: MessageHandler.cc:303
inet::ospfv2::Ospfv2Interface::NOT_DESIGNATED_ROUTER_STATE
@ NOT_DESIGNATED_ROUTER_STATE
Definition: Ospfv2Interface.h:56
inet::ospfv2::Neighbor::EXCHANGE_STATE
@ EXCHANGE_STATE
Definition: Ospfv2Neighbor.h:55
inet::ospfv2::Ospfv2Interface::PASSIVE
@ PASSIVE
Definition: Ospfv2Interface.h:63
inet::ospfv2::AuthenticationKeyType::bytes
char bytes[8]
Definition: Ospfv2Common.h:66
inet::ospfv2::DesignatedRouterId::ipInterfaceAddress
Ipv4Address ipInterfaceAddress
Definition: Ospfv2Common.h:148
inet::ospfv2::Ospfv2Interface::neighboringRoutersByAddress
std::map< Ipv4Address, Neighbor * > neighboringRoutersByAddress
Definition: Ospfv2Interface.h:88
inet::ospfv2::Ospfv2Interface::delayedAcknowledgements
std::map< Ipv4Address, std::list< Ospfv2LsaHeader > > delayedAcknowledgements
Definition: Ospfv2Interface.h:90
inet::ospfv2::Router::getRouterID
RouterId getRouterID() const
Definition: Ospfv2Router.h:60
inet::ospfv2::Ospfv2Interface::POINTTOMULTIPOINT
@ POINTTOMULTIPOINT
Definition: Ospfv2Interface.h:35
inet::physicallayer::k
const double k
Definition: Qam1024Modulation.cc:14
inet::ospfv2::setLsaCrc
void setLsaCrc(Ospfv2Lsa &lsa, CrcMode crcMode)
Definition: Ospfv2Crc.cc:49
inet::ospfv2::Ospfv2Interface::interfaceOutputCost
Metric interfaceOutputCost
Definition: Ospfv2Interface.h:93
inet::IPv4_MAX_HEADER_LENGTH
const B IPv4_MAX_HEADER_LENGTH
Definition: Ipv4Header_m.h:71
inet::ospfv2::Ospfv2Interface::LOOPBACK_STATE
@ LOOPBACK_STATE
Definition: Ospfv2Interface.h:53
inet::ospfv2::Ospfv2Interface::POINTTOPOINT_STATE
@ POINTTOPOINT_STATE
Definition: Ospfv2Interface.h:55
inet::ospfv2::Ospfv2Interface::acknowledgementDelay
short acknowledgementDelay
Definition: Ospfv2Interface.h:95
inet::ospfv2::Ospfv2Interface::interfaceAddressRange
Ipv4AddressRange interfaceAddressRange
Definition: Ospfv2Interface.h:76
inet::ospfv2::Ospfv2Interface::UNLOOP_INDICATION
@ UNLOOP_INDICATION
Definition: Ospfv2Interface.h:47
inet::ospfv2::Ospfv2Interface::createUpdatePacket
Packet * createUpdatePacket(const Ospfv2Lsa *lsa)
Definition: Ospfv2Interface.cc:472
inet::ospfv2::Ipv4AddressRange::address
Ipv4Address address
Definition: Ospfv2Common.h:71
inet::ospfv2::Ospfv2Interface::mtu
unsigned short mtu
Definition: Ospfv2Interface.h:75
inet::ospfv2::NETWORKLSA_TYPE
@ NETWORKLSA_TYPE
Definition: Ospfv2Packet_m.h:284
inet::ospfv2::Ospfv2Interface::getState
Ospfv2InterfaceStateType getState() const
Definition: Ospfv2Interface.cc:275
inet::ospfv2::Ospfv2Interface::BROADCAST
@ BROADCAST
Definition: Ospfv2Interface.h:33
inet::units::values::m
value< double, units::m > m
Definition: Units.h:1233
inet::ospfv2::Ospfv2Interface::getStateString
static const char * getStateString(Ospfv2InterfaceStateType stateType)
Definition: Ospfv2Interface.cc:280
inet::ospfv2::Ospfv2Interface::NO_OSPF
@ NO_OSPF
Definition: Ospfv2Interface.h:64
inet::ospfv2::Ospfv2Interface::DOWN_STATE
@ DOWN_STATE
Definition: Ospfv2Interface.h:52
inet::ospfv2::Ospfv2Interface::state
Ospfv2InterfaceState * state
Definition: Ospfv2Interface.h:71
inet::ospfv2::DesignatedRouterId::routerID
RouterId routerID
Definition: Ospfv2Common.h:147
inet::ospfv2::Ospfv2Interface::authenticationKey
AuthenticationKeyType authenticationKey
Definition: Ospfv2Interface.h:97
inet::ospfv2::Ospfv2Interface::BACKUP_STATE
@ BACKUP_STATE
Definition: Ospfv2Interface.h:57
inet::ospfv2::OSPFv2_HELLO_HEADER_LENGTH
const B OSPFv2_HELLO_HEADER_LENGTH
Definition: Ospfv2Common.h:41
inet::ospfv2::INTERFACE_WAIT_TIMER
@ INTERFACE_WAIT_TIMER
Definition: Ospfv2Packet_m.h:94
inet::ospfv2::Ospfv2InterfaceState::getState
virtual Ospfv2Interface::Ospfv2InterfaceStateType getState() const =0
inet::ospfv2::MessageHandler::clearTimer
void clearTimer(cMessage *timer)
Definition: MessageHandler.cc:370
inet::ospfv2::Ospfv2Interface::interfaceTransmissionDelay
short interfaceTransmissionDelay
Definition: Ospfv2Interface.h:82
inet::ospfv2::Ospfv2Interface::areaID
AreaId areaID
Definition: Ospfv2Interface.h:77
inet::Ipv4Address::ALL_OSPF_ROUTERS_MCAST
static const Ipv4Address ALL_OSPF_ROUTERS_MCAST
224.0.0.5 All OSPF routers (DR Others)
Definition: Ipv4Address.h:99
inet::ospfv2::Neighbor::KILL_NEIGHBOR
@ KILL_NEIGHBOR
Definition: Ospfv2Neighbor.h:40
inet::ospfv2::Ospfv2Interface::getIfIndex
int getIfIndex() const
Definition: Ospfv2Interface.h:137