INET Framework for OMNeT++/OMNEST
inet::Ieee8021dInterfaceData Class Reference

Per-interface data needed by the STP and RSTP protocols. More...

#include <Ieee8021dInterfaceData.h>

Inheritance diagram for inet::Ieee8021dInterfaceData:
inet::InterfaceProtocolData

Classes

class  PortInfo
 

Public Types

enum  PortRole {
  ALTERNATE, NOTASSIGNED, DISABLED, DESIGNATED,
  BACKUP, ROOT
}
 
enum  PortState { DISCARDING, LEARNING, FORWARDING }
 

Public Member Functions

 Ieee8021dInterfaceData ()
 
virtual std::string info () const override
 
virtual std::string detailedInfo () const override
 
bool isLearning () const
 
bool isForwarding () const
 
simtime_t getAge () const
 
void setAge (simtime_t age)
 
const MACAddressgetBridgeAddress () const
 
void setBridgeAddress (const MACAddress &bridgeAddress)
 
unsigned int getBridgePriority () const
 
void setBridgePriority (unsigned int bridgePriority)
 
simtime_t getFdWhile () const
 
void setFdWhile (simtime_t fdWhile)
 
simtime_t getFwdDelay () const
 
void setFwdDelay (simtime_t fwdDelay)
 
simtime_t getHelloTime () const
 
void setHelloTime (simtime_t helloTime)
 
unsigned int getLinkCost () const
 
void setLinkCost (unsigned int linkCost)
 
simtime_t getMaxAge () const
 
void setMaxAge (simtime_t maxAge)
 
unsigned int getPortNum () const
 
void setPortNum (unsigned int portNum)
 
unsigned int getPortPriority () const
 
void setPortPriority (unsigned int portPriority)
 
unsigned int getPriority () const
 
void setPriority (unsigned int priority)
 
PortRole getRole () const
 
void setRole (PortRole role)
 
const MACAddressgetRootAddress () const
 
void setRootAddress (const MACAddress &rootAddress)
 
unsigned int getRootPathCost () const
 
void setRootPathCost (unsigned int rootPathCost)
 
unsigned int getRootPriority () const
 
void setRootPriority (unsigned int rootPriority)
 
PortState getState () const
 
void setState (PortState state)
 
bool isEdge () const
 
void setEdge (bool edge)
 
simtime_t getTCWhile () const
 
void setTCWhile (simtime_t TCWhile)
 
unsigned int getLostBPDU () const
 
void setLostBPDU (unsigned int lostBPDU)
 
const char * getRoleName () const
 
const char * getStateName () const
 
simtime_t getNextUpgrade () const
 
void setNextUpgrade (simtime_t nextUpgrade)
 
- Public Member Functions inherited from inet::InterfaceProtocolData
 InterfaceProtocolData ()
 
InterfaceEntrygetInterfaceEntry () const
 Returns the InterfaceEntry that contains this data object, or nullptr. More...
 

Static Public Member Functions

static const char * getRoleName (PortRole role)
 
static const char * getStateName (PortState state)
 

Protected Attributes

PortInfo portData
 
- Protected Attributes inherited from inet::InterfaceProtocolData
InterfaceEntryownerp = nullptr
 

Additional Inherited Members

- Protected Member Functions inherited from inet::InterfaceProtocolData
virtual void changed (simsignal_t signalID, int fieldId)
 

Detailed Description

Per-interface data needed by the STP and RSTP protocols.

Member Enumeration Documentation

Enumerator
ALTERNATE 
NOTASSIGNED 
DISABLED 
DESIGNATED 
BACKUP 
ROOT 
Definition: Ieee8021dInterfaceData.h:37
Definition: Ieee8021dInterfaceData.h:37
Definition: Ieee8021dInterfaceData.h:37
Definition: Ieee8021dInterfaceData.h:37
Definition: Ieee8021dInterfaceData.h:37
Definition: Ieee8021dInterfaceData.h:37
Enumerator
DISCARDING 
LEARNING 
FORWARDING 
Definition: Ieee8021dInterfaceData.h:39
Definition: Ieee8021dInterfaceData.h:39
Definition: Ieee8021dInterfaceData.h:39

Constructor & Destructor Documentation

inet::Ieee8021dInterfaceData::Ieee8021dInterfaceData ( )
45 {
46 }

Member Function Documentation

std::string inet::Ieee8021dInterfaceData::detailedInfo ( ) const
overridevirtual
56 {
57  std::stringstream out;
58  out << "role:" << getRoleName() << "\tstate:" << getStateName() << "\n";
59  out << "priority:" << getPriority() << "\n";
60  out << "linkCost:" << getLinkCost() << "\n";
61 
62  return out.str();
63 }
const char * getRoleName() const
Definition: Ieee8021dInterfaceData.h:170
unsigned int getLinkCost() const
Definition: Ieee8021dInterfaceData.h:118
const char * getStateName() const
Definition: Ieee8021dInterfaceData.h:172
unsigned int getPriority() const
Definition: Ieee8021dInterfaceData.h:134
simtime_t inet::Ieee8021dInterfaceData::getAge ( ) const
inline

Referenced by inet::STP::checkTimers(), inet::STP::handleTick(), inet::RSTP::printState(), inet::RSTP::sendBPDU(), and inet::RSTP::sendTCNtoRoot().

94 { return portData.age; }
simtime_t age
Definition: Ieee8021dInterfaceData.h:62
PortInfo portData
Definition: Ieee8021dInterfaceData.h:82
const MACAddress& inet::Ieee8021dInterfaceData::getBridgeAddress ( ) const
inline
unsigned int inet::Ieee8021dInterfaceData::getBridgePriority ( ) const
inline
simtime_t inet::Ieee8021dInterfaceData::getFdWhile ( ) const
inline

Referenced by inet::STP::checkTimers(), and inet::STP::handleTick().

106 { return portData.fdWhile; }
simtime_t fdWhile
Definition: Ieee8021dInterfaceData.h:65
PortInfo portData
Definition: Ieee8021dInterfaceData.h:82
simtime_t inet::Ieee8021dInterfaceData::getFwdDelay ( ) const
inline

Referenced by inet::STP::selectRootPort().

110 { return portData.fwdDelay; }
simtime_t fwdDelay
Definition: Ieee8021dInterfaceData.h:66
PortInfo portData
Definition: Ieee8021dInterfaceData.h:82
simtime_t inet::Ieee8021dInterfaceData::getHelloTime ( ) const
inline

Referenced by inet::STP::selectRootPort().

114 { return portData.helloTime; }
PortInfo portData
Definition: Ieee8021dInterfaceData.h:82
simtime_t helloTime
Definition: Ieee8021dInterfaceData.h:69
unsigned int inet::Ieee8021dInterfaceData::getLostBPDU ( ) const
inline

Referenced by inet::RSTP::handleHelloTime().

166 { return portData.lostBPDU; }
unsigned int lostBPDU
Definition: Ieee8021dInterfaceData.h:74
PortInfo portData
Definition: Ieee8021dInterfaceData.h:82
simtime_t inet::Ieee8021dInterfaceData::getMaxAge ( ) const
inline

Referenced by inet::STP::selectRootPort().

122 { return portData.maxAge; }
simtime_t maxAge
Definition: Ieee8021dInterfaceData.h:63
PortInfo portData
Definition: Ieee8021dInterfaceData.h:82
simtime_t inet::Ieee8021dInterfaceData::getNextUpgrade ( ) const
inline

Referenced by inet::RSTP::handleUpgrade(), and inet::RSTP::scheduleNextUpgrade().

178 { return portData.nextUpgrade; }
simtime_t nextUpgrade
Definition: Ieee8021dInterfaceData.h:75
PortInfo portData
Definition: Ieee8021dInterfaceData.h:82
unsigned int inet::Ieee8021dInterfaceData::getPortNum ( ) const
inline
unsigned int inet::Ieee8021dInterfaceData::getPortPriority ( ) const
inline
unsigned int inet::Ieee8021dInterfaceData::getPriority ( ) const
inline

Referenced by detailedInfo(), inet::operator<<(), inet::STP::selectDesignatedPorts(), and inet::STP::selectRootPort().

134 { return portData.priority; }
unsigned int priority
Definition: Ieee8021dInterfaceData.h:47
PortInfo portData
Definition: Ieee8021dInterfaceData.h:82
const char* inet::Ieee8021dInterfaceData::getRoleName ( ) const
inline

Referenced by detailedInfo(), getRoleName(), info(), inet::RSTP::printState(), and inet::STPBase::refreshDisplay().

170 { return getRoleName(getRole()); }
PortRole getRole() const
Definition: Ieee8021dInterfaceData.h:138
const char * getRoleName() const
Definition: Ieee8021dInterfaceData.h:170
const char * inet::Ieee8021dInterfaceData::getRoleName ( PortRole  role)
static
66 {
67  switch (role) {
68  case ALTERNATE:
69  return "ALTERNATE";
70 
71  case NOTASSIGNED:
72  return "NOTASSIGNED";
73 
74  case DISABLED:
75  return "DISABLED";
76 
77  case DESIGNATED:
78  return "DESIGNATED";
79 
80  case BACKUP:
81  return "BACKUP";
82 
83  case ROOT:
84  return "ROOT";
85 
86  default:
87  throw cRuntimeError("Unknown port role %d", role);
88  }
89 }
Definition: Ieee8021dInterfaceData.h:37
Definition: Ieee8021dInterfaceData.h:37
Definition: Ieee8021dInterfaceData.h:37
Definition: Ieee8021dInterfaceData.h:37
Definition: Ieee8021dInterfaceData.h:37
Definition: Ieee8021dInterfaceData.h:37
unsigned int inet::Ieee8021dInterfaceData::getRootPathCost ( ) const
inline
unsigned int inet::Ieee8021dInterfaceData::getRootPriority ( ) const
inline
PortState inet::Ieee8021dInterfaceData::getState ( ) const
inline
const char* inet::Ieee8021dInterfaceData::getStateName ( ) const
inline

Referenced by detailedInfo(), getStateName(), info(), inet::RSTP::printState(), and inet::STPBase::refreshDisplay().

172 { return getStateName(getState()); }
const char * getStateName() const
Definition: Ieee8021dInterfaceData.h:172
PortState getState() const
Definition: Ieee8021dInterfaceData.h:154
const char * inet::Ieee8021dInterfaceData::getStateName ( PortState  state)
static
92 {
93  switch (state) {
94  case DISCARDING:
95  return "DISCARDING";
96 
97  case LEARNING:
98  return "LEARNING";
99 
100  case FORWARDING:
101  return "FORWARDING";
102 
103  default:
104  throw cRuntimeError("Unknown port state %d", state);
105  }
106 }
Definition: Ieee8021dInterfaceData.h:39
Definition: Ieee8021dInterfaceData.h:39
Definition: Ieee8021dInterfaceData.h:39
simtime_t inet::Ieee8021dInterfaceData::getTCWhile ( ) const
inline

Referenced by inet::RSTP::sendBPDU(), and inet::RSTP::sendTCNtoRoot().

162 { return portData.TCWhile; }
simtime_t TCWhile
Definition: Ieee8021dInterfaceData.h:72
PortInfo portData
Definition: Ieee8021dInterfaceData.h:82
std::string inet::Ieee8021dInterfaceData::info ( ) const
overridevirtual
49 {
50  std::stringstream out;
51  out << "role:" << getRoleName() << " state:" << getStateName();
52  return out.str();
53 }
const char * getRoleName() const
Definition: Ieee8021dInterfaceData.h:170
const char * getStateName() const
Definition: Ieee8021dInterfaceData.h:172
bool inet::Ieee8021dInterfaceData::isEdge ( ) const
inline

Referenced by inet::RSTP::handleHelloTime(), inet::RSTP::initPorts(), inet::RSTP::printState(), inet::RSTP::processBetterSource(), and inet::RSTP::sendBPDUs().

158 { return portData.edge; }
PortInfo portData
Definition: Ieee8021dInterfaceData.h:82
bool edge
Definition: Ieee8021dInterfaceData.h:49
bool inet::Ieee8021dInterfaceData::isForwarding ( ) const
inline

Referenced by inet::Ieee8021dRelay::handleAndDispatchFrame(), inet::STPTester::isForwarding(), and inet::operator<<().

92 { return portData.state == FORWARDING; }
PortState state
Definition: Ieee8021dInterfaceData.h:51
PortInfo portData
Definition: Ieee8021dInterfaceData.h:82
Definition: Ieee8021dInterfaceData.h:39
bool inet::Ieee8021dInterfaceData::isLearning ( ) const
inline

Referenced by inet::Ieee8021dRelay::learn(), and inet::operator<<().

90 { return portData.state == LEARNING || portData.state == FORWARDING; }
PortState state
Definition: Ieee8021dInterfaceData.h:51
Definition: Ieee8021dInterfaceData.h:39
PortInfo portData
Definition: Ieee8021dInterfaceData.h:82
Definition: Ieee8021dInterfaceData.h:39
void inet::Ieee8021dInterfaceData::setAge ( simtime_t  age)
inline
void inet::Ieee8021dInterfaceData::setBridgeAddress ( const MACAddress bridgeAddress)
inline
void inet::Ieee8021dInterfaceData::setBridgePriority ( unsigned int  bridgePriority)
inline
void inet::Ieee8021dInterfaceData::setEdge ( bool  edge)
inline

Referenced by inet::L2NetworkConfigurator::configureInterface().

160 { portData.edge = edge; }
PortInfo portData
Definition: Ieee8021dInterfaceData.h:82
bool edge
Definition: Ieee8021dInterfaceData.h:49
void inet::Ieee8021dInterfaceData::setFdWhile ( simtime_t  fdWhile)
inline

Referenced by inet::STP::checkTimers(), inet::STP::handleTick(), and inet::STP::isSuperiorBPDU().

108 { portData.fdWhile = fdWhile; }
simtime_t fdWhile
Definition: Ieee8021dInterfaceData.h:65
PortInfo portData
Definition: Ieee8021dInterfaceData.h:82
void inet::Ieee8021dInterfaceData::setFwdDelay ( simtime_t  fwdDelay)
inline

Referenced by inet::STP::setSuperiorBPDU().

112 { portData.fwdDelay = fwdDelay; }
simtime_t fwdDelay
Definition: Ieee8021dInterfaceData.h:66
PortInfo portData
Definition: Ieee8021dInterfaceData.h:82
void inet::Ieee8021dInterfaceData::setHelloTime ( simtime_t  helloTime)
inline

Referenced by inet::STP::setSuperiorBPDU().

116 { portData.helloTime = helloTime; }
PortInfo portData
Definition: Ieee8021dInterfaceData.h:82
simtime_t helloTime
Definition: Ieee8021dInterfaceData.h:69
void inet::Ieee8021dInterfaceData::setLinkCost ( unsigned int  linkCost)
inline

Referenced by inet::L2NetworkConfigurator::configureInterface().

120 { portData.linkCost = linkCost; }
unsigned int linkCost
Definition: Ieee8021dInterfaceData.h:48
PortInfo portData
Definition: Ieee8021dInterfaceData.h:82
void inet::Ieee8021dInterfaceData::setLostBPDU ( unsigned int  lostBPDU)
inline
void inet::Ieee8021dInterfaceData::setMaxAge ( simtime_t  maxAge)
inline

Referenced by inet::STP::setSuperiorBPDU().

124 { portData.maxAge = maxAge; }
simtime_t maxAge
Definition: Ieee8021dInterfaceData.h:63
PortInfo portData
Definition: Ieee8021dInterfaceData.h:82
void inet::Ieee8021dInterfaceData::setNextUpgrade ( simtime_t  nextUpgrade)
inline
void inet::Ieee8021dInterfaceData::setPortNum ( unsigned int  portNum)
inline
void inet::Ieee8021dInterfaceData::setPortPriority ( unsigned int  portPriority)
inline
void inet::Ieee8021dInterfaceData::setPriority ( unsigned int  priority)
inline

Referenced by inet::L2NetworkConfigurator::configureInterface().

136 { portData.priority = priority; }
unsigned int priority
Definition: Ieee8021dInterfaceData.h:47
PortInfo portData
Definition: Ieee8021dInterfaceData.h:82
void inet::Ieee8021dInterfaceData::setRootAddress ( const MACAddress rootAddress)
inline
void inet::Ieee8021dInterfaceData::setRootPathCost ( unsigned int  rootPathCost)
inline
void inet::Ieee8021dInterfaceData::setRootPriority ( unsigned int  rootPriority)
inline
void inet::Ieee8021dInterfaceData::setTCWhile ( simtime_t  TCWhile)
inline

Referenced by inet::RSTP::checkTC(), inet::RSTP::flushOtherPorts(), and inet::RSTP::processBetterSource().

164 { portData.TCWhile = TCWhile; }
simtime_t TCWhile
Definition: Ieee8021dInterfaceData.h:72
PortInfo portData
Definition: Ieee8021dInterfaceData.h:82

Member Data Documentation

PortInfo inet::Ieee8021dInterfaceData::portData
protected

The documentation for this class was generated from the following files: