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
Port Class Reference

Port holds and manipulates the ports on devices. More...

Inheritance diagram for Port:
Process CloudPotsPort CloudSerialPort ConsolePort HostPort IoEComponent SwitchPort UsbPort RouterPort CustomIO FRSubInterface RoutedSwitchPort VirtualTemplateInterface

Public Member Functions

string getName ()
 Returns the name of the port. More...
 
int getChannel ()
 Returns the channel of the port. More...
 
void setChannel (int)
 Sets the channel of the port. More...
 
string getTerminalTypeShortString ()
 Returns the name of the port shortened, without number. More...
 
string getPortNameNumber ()
 Returns the port number. Can have something like 0/0/0, etc. More...
 
PortType getType ()
 Returns the type of the port. More...
 
void setDescription (string)
 Sets the description for the port. More...
 
string getDescription ()
 Returns the description of the port. More...
 
void setPower (bool)
 Sets the power state for the port. More...
 
bool getPower ()
 Returns true if the port is on, false if the port is off. More...
 
void powerChanged (bool)
 This event is emitted when the power state of the port changes. More...
 
bool isStraightPins ()
 Returns true if the pins are straight, for ethernet. More...
 
bool isAutoCross ()
 Returns true if the port is configured for auto crossover, for ethernet. More...
 
void setBandwidth (int)
 Sets the bandwidth for the port. More...
 
int getBandwidth ()
 Returns the bandwidth of the port. More...
 
void setBandwidthAutoNegotiate (bool)
 Enables or disables bandwidth auto negotiation. More...
 
bool isBandwidthAutoNegotiate ()
 Returns true if bandwidth auto negotiation is enabled, otherwise false. More...
 
void setFullDuplex (bool)
 Enables or disables full duplex mode. More...
 
bool isFullDuplex ()
 Returns true if full duplex mode is enabled, otherwise false. More...
 
void setDuplexAutoNegotiate (bool)
 Enables or disables duplex auto negotiation. More...
 
bool isDuplexAutoNegotiate ()
 Returns true if duplex auto negotiation is enabled, otherwise false. More...
 
void setMacAddress (mac)
 Sets the MAC address on the port. More...
 
mac getMacAddress ()
 Returns the MAC address set on the port. More...
 
void macChanged (mac, mac)
 This event is emitted when the MAC address on the port changes. More...
 
mac getBia ()
 Returns the burned-in address of the port. More...
 
void setClockRate (int)
 Sets the clock rate on the port. More...
 
int getClockRate ()
 Returns the clock rate on the port. More...
 
Link getLink ()
 Returns the link connected to the port. More...
 
bool isProtocolUp ()
 Returns true if the line protocol is up on the port, otherwise false. More...
 
bool isPortUp ()
 Returns true if the status is up on the port, otherwise false. More...
 
Process getEncapProcess ()
 Returns the encapsulation process. More...
 
Process getKeepAliveProcess ()
 Returns the keepalive process. More...
 
QString getRemotePortName ()
 Returns the name of the remote port. More...
 
LightStatus getLightStatus ()
 Returns the link light status. More...
 
void lightStatusChanged (LightStatus)
 This event is emitted when the link light changes. More...
 
void lightBlinked ()
 This event is emitted when the link light blinks. More...
 
void portStatusChanged (bool)
 This event is emitted when the port status changes. More...
 
void lineProtocolChanged (bool)
 This event is emitted when the line protocol status changes. More...
 
void packetReceived (string, int)
 This event is emitted when the port receives a packet. More...
 
void packetSent (string, int)
 This event is emitted when the port sends a packet. More...
 
void packetReceivedWithDetails (Signal, int)
 This event is emitted when the port receives a packet with details. More...
 
void packetSentWithDetails (Signal, int)
 This event is emitted when the port sends a packet with details. More...
 
int getHigherProcessCount ()
 Returns the higher process count. More...
 
HardwareQueue getHardwareQueue ()
 Returns the hardware queue. More...
 
QueueProcess getQosQueue ()
 Returns the qos queue. More...
 
bool isEthernetPort ()
 Returns true if it is a ethernet port, false if not. More...
 
bool isWirelessPort ()
 Returns true if it is a wireless port, false if not. More...
 
bool isPowerOn ()
 Returns true if the power is on, false if not. More...
 
void deleteLink ()
 
- Public Member Functions inherited from Process
Device getOwnerDevice ()
 Returns the device for this process. More...
 

Detailed Description

Port holds and manipulates the ports on devices.

Member Function Documentation

◆ deleteLink()

void Port::deleteLink ( )

◆ getBandwidth()

int Port::getBandwidth ( )

Returns the bandwidth of the port.

Returns
int, the bandwidth of the port.

◆ getBia()

mac Port::getBia ( )

Returns the burned-in address of the port.

Returns
mac, the burned-in address of the port.

◆ getChannel()

int Port::getChannel ( )

Returns the channel of the port.

Returns
int, the channel of the port.

◆ getClockRate()

int Port::getClockRate ( )

Returns the clock rate on the port.

Returns
int, the clock rate on the port.

◆ getDescription()

string Port::getDescription ( )

Returns the description of the port.

Returns
string, the description of the port.

◆ getEncapProcess()

Process Port::getEncapProcess ( )

Returns the encapsulation process.

Returns
Process, the Process object.

◆ getHardwareQueue()

HardwareQueue Port::getHardwareQueue ( )

Returns the hardware queue.

Returns
HardwareQueue, the hardware queue.

◆ getHigherProcessCount()

int Port::getHigherProcessCount ( )

Returns the higher process count.

Returns
int, the higher process count.

◆ getKeepAliveProcess()

Process Port::getKeepAliveProcess ( )

Returns the keepalive process.

Returns
Process, the Process object.

◆ getLightStatus()

LightStatus Port::getLightStatus ( )

Returns the link light status.

Returns
enum<LightStatus>, the link light status. Link light statuses: eOffLight = 0, eAmberLight = 1, eGreenLight = 2, eBlink = 3

◆ getLink()

Link Port::getLink ( )

Returns the link connected to the port.

Returns
Link, the Link object connected to the port.

◆ getMacAddress()

mac Port::getMacAddress ( )

Returns the MAC address set on the port.

Returns
mac, the MAC address set on the port.

◆ getName()

string Port::getName ( )

Returns the name of the port.

Returns
string, the name of the port.

◆ getPortNameNumber()

string Port::getPortNameNumber ( )

Returns the port number. Can have something like 0/0/0, etc.

Returns
string, the name of the port.

◆ getPower()

bool Port::getPower ( )

Returns true if the port is on, false if the port is off.

Returns
bool, true if the port is on, false if the port is off.

◆ getQosQueue()

QueueProcess Port::getQosQueue ( )

Returns the qos queue.

Returns
QueueProcess, the qos queue.

◆ getRemotePortName()

QString Port::getRemotePortName ( )

Returns the name of the remote port.

Returns
QString, the name of the remote port.

◆ getTerminalTypeShortString()

string Port::getTerminalTypeShortString ( )

Returns the name of the port shortened, without number.

Returns
string, the name of the port.

◆ getType()

PortType Port::getType ( )

Returns the type of the port.

Returns
enum<PortType>, the type of the port. Port types: eConsole = 0, eAux = 1, eCopperEthernet = 2, eCopperFastEthernet = 3, eCopperGigabitEthernet = 4, eFiberFastEthernet = 5, eFiberGigabitEthernet = 6, eSerial = 7, eSmartSerial = 8, eAccessPointWirelessG = 9, eAccessPointWirelessN = 10, eAccessPointWirelessA = 11, eHostWirelessG = 12, eHostWirelessN = 13, eSubInterface = 14, eLoopback = 15, ePortChannel = 16, eVlan = 17, eModem = 18, eRs232 = 19, eFRSubInterface = 20, eCopperCoaxial = 21, eCoaxial7 = 22, eVirtualLink = 23, eHostWirelessA = 24, eTunnel = 25, eVirtualTemplate = 26, ePtCoAxialSplitterModule = 27, eVirtualAccess = 28, eTerminal = 29, eAsync = 30, eNull = 31, eWlanGigabitEthernet = 32, eWlanConsole = 33, eBVI = 34, eAccessPoint3G = 35, eHost3G = 36, eUsbPort = 37, eGenericIoE = 38, eCustomIO = 39, eVirtualPortGroup = 40, ePoE = 41, eTty = 42, eUsbConsole = 43

◆ isAutoCross()

bool Port::isAutoCross ( )

Returns true if the port is configured for auto crossover, for ethernet.

Returns
bool, true if the port is configured for auto crossover, otherwise false.

◆ isBandwidthAutoNegotiate()

bool Port::isBandwidthAutoNegotiate ( )

Returns true if bandwidth auto negotiation is enabled, otherwise false.

Returns
bool, true if bandwidth auto negotiation is enabled, otherwise false.

◆ isDuplexAutoNegotiate()

bool Port::isDuplexAutoNegotiate ( )

Returns true if duplex auto negotiation is enabled, otherwise false.

Returns
bool, true if duplex auto negotiation is enabled, otherwise false.

◆ isEthernetPort()

bool Port::isEthernetPort ( )

Returns true if it is a ethernet port, false if not.

Returns
bool, true if it is a ethernet port, false if not.

◆ isFullDuplex()

bool Port::isFullDuplex ( )

Returns true if full duplex mode is enabled, otherwise false.

Returns
bool, true if full duplex mode is enabled, otherwise false.

◆ isPortUp()

bool Port::isPortUp ( )

Returns true if the status is up on the port, otherwise false.

Returns
bool, true if the status is up on the port, otherwise false.

◆ isPowerOn()

bool Port::isPowerOn ( )

Returns true if the power is on, false if not.

Returns
bool, true if the power is on, false if not.

◆ isProtocolUp()

bool Port::isProtocolUp ( )

Returns true if the line protocol is up on the port, otherwise false.

Returns
bool, true if the line protocol is up on the port, otherwise false.

◆ isStraightPins()

bool Port::isStraightPins ( )

Returns true if the pins are straight, for ethernet.

Returns
bool, true if the pins are straight, otherwise false.

◆ isWirelessPort()

bool Port::isWirelessPort ( )

Returns true if it is a wireless port, false if not.

Returns
bool, true if it is a wireless port, false if not.

◆ lightBlinked()

void Port::lightBlinked ( )

This event is emitted when the link light blinks.

IPC event.

◆ lightStatusChanged()

void Port::lightStatusChanged ( LightStatus  )

This event is emitted when the link light changes.

  • status, the link light status. Link light statuses: eOffLight = 0, eAmberLight = 1, eGreenLight = 2, eBlink = 3

IPC event.

◆ lineProtocolChanged()

void Port::lineProtocolChanged ( bool  )

This event is emitted when the line protocol status changes.

  • portUp, true if the line protocol went up, false if the line protocol went down.

IPC event.

◆ macChanged()

void Port::macChanged ( mac  ,
mac   
)

This event is emitted when the MAC address on the port changes.

  • newMac, the new MAC address of the port.
  • oldMac, the old MAC address of the port.

IPC event.

◆ packetReceived()

void Port::packetReceived ( string  ,
int   
)

This event is emitted when the port receives a packet.

  • type, the type of packet.
  • size, the size of the packet.

IPC event.

◆ packetReceivedWithDetails()

void Port::packetReceivedWithDetails ( Signal  ,
int   
)

This event is emitted when the port receives a packet with details.

  • pdu, the traffic signal of the packet.
  • size, the size of the packet.

IPC event.

◆ packetSent()

void Port::packetSent ( string  ,
int   
)

This event is emitted when the port sends a packet.

  • type, the type of packet.
  • size, the size of the packet.

IPC event.

◆ packetSentWithDetails()

void Port::packetSentWithDetails ( Signal  ,
int   
)

This event is emitted when the port sends a packet with details.

  • pdu, the traffic signal of the packet.
  • size, the size of the packet.

IPC event.

◆ portStatusChanged()

void Port::portStatusChanged ( bool  )

This event is emitted when the port status changes.

  • portUp, true if the port went up, false if the port went down.

IPC event.

◆ powerChanged()

void Port::powerChanged ( bool  )

This event is emitted when the power state of the port changes.

  • on, true if the port turned on, false if the port turned off.

IPC event.

◆ setBandwidth()

void Port::setBandwidth ( int  )

Sets the bandwidth for the port.

Parameters
bandwidth,thebandwidth for the port.

◆ setBandwidthAutoNegotiate()

void Port::setBandwidthAutoNegotiate ( bool  )

Enables or disables bandwidth auto negotiation.

Parameters
autoNegotiate,trueto enable bandwidth auto negotiation, false to disable it.

◆ setChannel()

void Port::setChannel ( int  )

Sets the channel of the port.

\channel, the channel of the port.

◆ setClockRate()

void Port::setClockRate ( int  )

Sets the clock rate on the port.

Parameters
clockrate,theclock rate to set on the port.

◆ setDescription()

void Port::setDescription ( string  )

Sets the description for the port.

Parameters
description,thedescription for the port.

◆ setDuplexAutoNegotiate()

void Port::setDuplexAutoNegotiate ( bool  )

Enables or disables duplex auto negotiation.

Parameters
autoNegotiate,trueto enable duplex auto negotiation, false to disable it.

◆ setFullDuplex()

void Port::setFullDuplex ( bool  )

Enables or disables full duplex mode.

Parameters
fullDuplex,trueto enable full duplex mode, false to disable it.

◆ setMacAddress()

void Port::setMacAddress ( mac  )

Sets the MAC address on the port.

Parameters
macAddress,theMAC address to set on the port.

◆ setPower()

void Port::setPower ( bool  )

Sets the power state for the port.

Parameters
bOn,trueto turn the port on, false to turn it off.

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