Cisco Packet Tracer Extensions API 8.1.0
API for communication between Cisco Packet Tracer application and its extension applications and modules.
Public Member Functions | List of all members
StpProcess Class Reference

StpProcess handles and manipulates STP processes. More...

Inheritance diagram for StpProcess:
Process

Public Member Functions

int getSwitchPriority ()
 Returns the priority. More...
 
string getRootBridgeId ()
 Returns the root bridge ID. More...
 
int getPortCount ()
 Returns the number of ports in the STP process. More...
 
bool isRootBridge ()
 Returns true if this switch is the root bridge, otherwise false. More...
 
string getSwitchId ()
 Returns the ID for this switch. More...
 
bool hasPort (string)
 Returns true if the specified port is in this STP process, otherwise false. More...
 
SwitchPort getRootPort ()
 Returns the root port in this STP process. More...
 
int getRootPathCost ()
 Returns the root path cost. More...
 
void rootChanged (QString, int, mac, int, mac, int)
 This event is emitted when the root bridge is changed. More...
 
void stpPortStateChanged (QString, int, int, StpPortState, StpPortState)
 This event is emitted when the PVST+ port state for this VLAN changes. More...
 
void rstpPortStateChanged (QString, int, int, RstpPortState, RstpPortState)
 This event is emitted when the Rapid-PVST port state for this VLAN changes. More...
 
- Public Member Functions inherited from Process
Device getOwnerDevice ()
 Returns the device for this process. More...
 

Detailed Description

StpProcess handles and manipulates STP processes.

Member Function Documentation

◆ getPortCount()

int StpProcess::getPortCount ( )

Returns the number of ports in the STP process.

Returns
int, the number of ports in the STP process.

◆ getRootBridgeId()

string StpProcess::getRootBridgeId ( )

Returns the root bridge ID.

Returns
string, the root bridge ID.

◆ getRootPathCost()

int StpProcess::getRootPathCost ( )

Returns the root path cost.

Returns
int, the root path cost.

◆ getRootPort()

SwitchPort StpProcess::getRootPort ( )

Returns the root port in this STP process.

Returns
SwitchPort, the SwitchPort object.

◆ getSwitchId()

string StpProcess::getSwitchId ( )

Returns the ID for this switch.

Returns
string, the ID for this switch.

◆ getSwitchPriority()

int StpProcess::getSwitchPriority ( )

Returns the priority.

Returns
int, the priority.

◆ hasPort()

bool StpProcess::hasPort ( string  )

Returns true if the specified port is in this STP process, otherwise false.

Parameters
portName,portNamecan be one of the following plus a port number where appropriate: Console, Aux, Ethernet, FastEthernet, GigabitEthernet, Serial, Wireless, Loopback, Vlan, Modem, Coaxial, Rs232, Async. Example: FastEthernet0/0
Returns
bool, true if the specified port is in this STP process, otherwise false.

◆ isRootBridge()

bool StpProcess::isRootBridge ( )

Returns true if this switch is the root bridge, otherwise false.

Returns
bool, true if this switch is the root bridge, otherwise false.

◆ rootChanged()

void StpProcess::rootChanged ( QString  ,
int  ,
mac  ,
int  ,
mac  ,
int   
)

This event is emitted when the root bridge is changed.

  • ownerSwitch, the new root switch.
  • vlan, the VLAN number.
  • oldMac, the MAC address of the old root.
  • oldPriority, the priority of the old root.
  • newMac, the MAC address of the new root.
  • newPriority, the priority of the new root.

IPC event.

◆ rstpPortStateChanged()

void StpProcess::rstpPortStateChanged ( QString  ,
int  ,
int  ,
RstpPortState  ,
RstpPortState   
)

This event is emitted when the Rapid-PVST port state for this VLAN changes.

  • ownerSwitch, the switch this event occurred on.
  • vlan, the VLAN number.
  • portNumber, the port number.
  • oldStatus, the old STP port state. STP port states: eStpDisabled = 0, eStpBlocking = 1, eStpListening = 2, eStpLearning = 3, eStpForwarding = 4, eStpInconsistent = 5, eStpErrorDisabled = 6
  • newStatus, the new port state.

IPC event.

◆ stpPortStateChanged()

void StpProcess::stpPortStateChanged ( QString  ,
int  ,
int  ,
StpPortState  ,
StpPortState   
)

This event is emitted when the PVST+ port state for this VLAN changes.

  • ownerSwitch, the switch this event occurred on.
  • vlan, the VLAN number.
  • portNumber, the port number.
  • oldStatus, the old STP port state. STP port states: eStpDisabled = 0, eStpBlocking = 1, eStpListening = 2, eStpLearning = 3, eStpForwarding = 4, eStpInconsistent = 5, eStpErrorDisabled = 6
  • newStatus, the new port state.

IPC event.


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