INET Framework for OMNeT++/OMNEST
|
Implements the Spanning Tree Protocol. More...
#include <STP.h>
Public Types | |
enum | BDPUType { CONFIG_BDPU = 0, TCN_BPDU = 1 } |
typedef Ieee8021dInterfaceData::PortInfo | PortInfo |
Public Member Functions | |
STP () | |
virtual | ~STP () |
void | handleBPDU (BPDU *bpdu) |
virtual void | initInterfacedata (unsigned int portNum) |
void | handleTCN (BPDU *tcn) |
Topology change handling. More... | |
virtual void | handleMessage (cMessage *msg) override |
virtual void | initialize (int stage) override |
virtual int | numInitStages () const override |
void | generateBPDU (int portNum, const MACAddress &address=MACAddress::STP_MULTICAST_ADDRESS, bool tcFlag=false, bool tcaFlag=false) |
void | generateHelloBDPUs () |
void | generateTCN () |
int | comparePorts (Ieee8021dInterfaceData *portA, Ieee8021dInterfaceData *portB) |
int | compareBridgeIDs (unsigned int, MACAddress, unsigned int, MACAddress) |
int | comparePortIDs (unsigned int, unsigned int, unsigned int, unsigned int) |
bool | isSuperiorBPDU (int portNum, BPDU *bpdu) |
void | setSuperiorBPDU (int portNum, BPDU *bpdu) |
void | handleTick () |
void | checkTimers () |
void | checkParametersChange () |
void | initPortTable () |
void | selectRootPort () |
void | selectDesignatedPorts () |
void | setAllDesignated () |
void | lostRoot () |
void | lostAlternate (int port) |
void | reset () |
bool | checkRootEligibility () |
void | tryRoot () |
Public Member Functions inherited from inet::STPBase | |
STPBase () | |
virtual bool | handleOperationStage (LifecycleOperation *operation, int stage, IDoneCallback *doneCallback) override |
Perform one stage of a lifecycle operation. More... | |
virtual void | receiveSignal (cComponent *source, simsignal_t signalID, cObject *obj, cObject *details) override |
Public Member Functions inherited from inet::ILifecycle | |
virtual | ~ILifecycle () |
Protected Member Functions | |
virtual void | start () override |
virtual void | stop () override |
Protected Member Functions inherited from inet::STPBase | |
virtual void | colorLink (unsigned int i, bool forwarding) const |
Adds effects to be represented by Tkenv. More... | |
virtual void | refreshDisplay () const override |
Adds effects to be represented by Tkenv. More... | |
virtual int | getRootIndex () const |
Obtains the root gate index. More... | |
Ieee8021dInterfaceData * | getPortInterfaceData (unsigned int portNum) |
Gets Ieee8021dInterfaceData for port number. More... | |
const Ieee8021dInterfaceData * | getPortInterfaceData (unsigned int portNum) const |
InterfaceEntry * | getPortInterfaceEntry (unsigned int portNum) |
Gets InterfaceEntry for port number. More... | |
virtual InterfaceEntry * | chooseInterface () |
Protected Attributes | |
bool | isRoot = false |
unsigned int | rootPort = 0 |
std::vector< unsigned int > | desPorts |
unsigned int | rootPathCost = 0 |
unsigned int | rootPriority = 0 |
MACAddress | rootAddress |
simtime_t | currentMaxAge |
simtime_t | currentFwdDelay |
simtime_t | currentHelloTime |
simtime_t | helloTime |
unsigned int | currentBridgePriority = 0 |
bool | topologyChangeNotification = false |
bool | topologyChangeRecvd = false |
PortInfo | defaultPort |
cMessage * | tick = nullptr |
Protected Attributes inherited from inet::STPBase | |
bool | visualize = false |
bool | isOperational = false |
unsigned int | numPorts = 0 |
unsigned int | bridgePriority = 0 |
MACAddress | bridgeAddress |
simtime_t | maxAge |
simtime_t | helloTime |
simtime_t | forwardDelay |
cModule * | switchModule = nullptr |
IMACAddressTable * | macTable = nullptr |
IInterfaceTable * | ifTable = nullptr |
InterfaceEntry * | ie = nullptr |
Static Protected Attributes | |
static const double | tickInterval = 1 |
Friends | |
std::ostream & | operator<< (std::ostream &os, const Ieee8021dInterfaceData::PortRole r) |
std::ostream & | operator<< (std::ostream &os, const Ieee8021dInterfaceData::PortState s) |
std::ostream & | operator<< (std::ostream &os, Ieee8021dInterfaceData *p) |
std::ostream & | operator<< (std::ostream &os, STP i) |
Implements the Spanning Tree Protocol.
See the NED file for details.
enum inet::STP::BDPUType |
|
virtual |
void inet::STP::checkParametersChange | ( | ) |
Referenced by handleTick().
bool inet::STP::checkRootEligibility | ( | ) |
Referenced by tryRoot().
void inet::STP::checkTimers | ( | ) |
Referenced by handleTick().
int inet::STP::compareBridgeIDs | ( | unsigned int | aPriority, |
MACAddress | aAddress, | ||
unsigned int | bPriority, | ||
MACAddress | bAddress | ||
) |
Referenced by checkRootEligibility(), and comparePorts().
int inet::STP::comparePortIDs | ( | unsigned int | aPriority, |
unsigned int | aNum, | ||
unsigned int | bPriority, | ||
unsigned int | bNum | ||
) |
Referenced by comparePorts().
int inet::STP::comparePorts | ( | Ieee8021dInterfaceData * | portA, |
Ieee8021dInterfaceData * | portB | ||
) |
Referenced by isSuperiorBPDU(), selectDesignatedPorts(), and selectRootPort().
void inet::STP::generateBPDU | ( | int | portNum, |
const MACAddress & | address = MACAddress::STP_MULTICAST_ADDRESS , |
||
bool | tcFlag = false , |
||
bool | tcaFlag = false |
||
) |
Referenced by generateHelloBDPUs(), handleBPDU(), and handleTCN().
void inet::STP::generateHelloBDPUs | ( | ) |
Referenced by checkTimers().
void inet::STP::generateTCN | ( | ) |
Referenced by handleTick().
void inet::STP::handleBPDU | ( | BPDU * | bpdu | ) |
Referenced by handleMessage().
|
overridevirtual |
void inet::STP::handleTCN | ( | BPDU * | tcn | ) |
Topology change handling.
Referenced by handleMessage().
void inet::STP::handleTick | ( | ) |
Referenced by handleMessage().
|
overridevirtual |
Reimplemented from inet::STPBase.
|
virtual |
Referenced by checkTimers(), and initPortTable().
void inet::STP::initPortTable | ( | ) |
Referenced by start().
bool inet::STP::isSuperiorBPDU | ( | int | portNum, |
BPDU * | bpdu | ||
) |
Referenced by handleBPDU().
void inet::STP::lostAlternate | ( | int | port | ) |
Referenced by checkTimers().
void inet::STP::lostRoot | ( | ) |
Referenced by checkTimers().
|
inlineoverridevirtual |
Reimplemented from inet::STPBase.
void inet::STP::reset | ( | ) |
Referenced by checkParametersChange().
void inet::STP::selectDesignatedPorts | ( | ) |
Referenced by lostAlternate(), and tryRoot().
void inet::STP::selectRootPort | ( | ) |
Referenced by tryRoot().
void inet::STP::setAllDesignated | ( | ) |
void inet::STP::setSuperiorBPDU | ( | int | portNum, |
BPDU * | bpdu | ||
) |
Referenced by isSuperiorBPDU().
|
overrideprotectedvirtual |
Reimplemented from inet::STPBase.
|
overrideprotectedvirtual |
Reimplemented from inet::STPBase.
void inet::STP::tryRoot | ( | ) |
Referenced by handleBPDU(), and lostRoot().
|
friend |
|
friend |
|
friend |
|
friend |
|
protected |
Referenced by checkParametersChange(), and start().
|
protected |
Referenced by checkParametersChange(), checkTimers(), generateBPDU(), handleBPDU(), inet::operator<<(), reset(), selectRootPort(), start(), and tryRoot().
|
protected |
Referenced by checkParametersChange(), checkTimers(), generateBPDU(), inet::operator<<(), reset(), selectRootPort(), start(), and tryRoot().
|
protected |
Referenced by checkParametersChange(), checkTimers(), generateBPDU(), inet::operator<<(), reset(), selectRootPort(), start(), and tryRoot().
|
protected |
|
protected |
Referenced by handleBPDU(), selectDesignatedPorts(), selectRootPort(), and setAllDesignated().
|
protected |
Referenced by checkParametersChange(), checkTimers(), handleTick(), inet::operator<<(), reset(), start(), and tryRoot().
|
protected |
Referenced by checkParametersChange(), checkTimers(), generateBPDU(), handleTCN(), handleTick(), inet::operator<<(), reset(), start(), stop(), and tryRoot().
|
protected |
Referenced by generateBPDU(), inet::operator<<(), reset(), selectDesignatedPorts(), selectRootPort(), start(), and tryRoot().
|
protected |
Referenced by generateBPDU(), inet::operator<<(), reset(), selectDesignatedPorts(), selectRootPort(), start(), and tryRoot().
|
protected |
Referenced by generateTCN(), handleTCN(), inet::operator<<(), selectRootPort(), and start().
|
protected |
Referenced by generateBPDU(), inet::operator<<(), reset(), selectDesignatedPorts(), selectRootPort(), start(), and tryRoot().
|
protected |
Referenced by handleMessage(), initialize(), start(), stop(), and ~STP().
|
staticprotected |
Referenced by handleTick(), and start().
|
protected |
Referenced by generateBPDU(), generateTCN(), handleBPDU(), handleTCN(), lostAlternate(), lostRoot(), selectRootPort(), start(), and stop().
|
protected |
Referenced by generateTCN(), handleBPDU(), and start().