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

Simulation holds the traffic details like PDUs, ports, etc. More...

Public Member Functions

int getFrameInstanceCount ()
 Returns the number of FrameInstances at present in the simulation. More...
 
FrameInstance getFrameInstanceAt (int)
 Returns the FrameInstance at the specified index in the simulation event list. More...
 
int getCurrentFrameInstanceIndex ()
 Returns index of "current" frame instance. More...
 
void resetSimulation ()
 Resets simulation and fires the event. More...
 
void forwardStarted ()
 This event is emitted when simulation playback is started. More...
 
void forwardEnded ()
 This event is emitted when simulation playback is stopped. More...
 
void newFrameInstanceAdded (TrafficType, int)
 This event is emitted when a new frame instance is added. More...
 
void simulationReset ()
 This event is emitted when the simulation is reset. More...
 
void simulationBufferFull ()
 IPC event. More...
 
void simulationModeChanged ()
 This event is emitted when the Realtime or Simulation Mode is changed. More...
 
bool isSimulationMode ()
 Returns true if in Simulation Mode, otherwise false. More...
 
FrameInstance createFrameInstance (Device, TrafficType, int, QString)
 Create FrameInstance to be sent from a device. More...
 
FrameInstance createFrameInstanceCustomType (Device, QString, int, QString)
 Create FrameInstance to be sent from a device with a custom traffic type. More...
 
void finalizeFrameInstance (FrameInstance)
 Finalize frame instance. More...
 
SimulationTimer createTimer (int, bool)
 Create Simulation Timer. More...
 
uuid createTimerUuid (int, bool)
 Create Simulation Timer and return the uuid of the timer object. More...
 
SimulationTimer getIpcTimer (uuid)
 Get Simulation Timer based on uuid. More...
 
long getCurrentSimTime ()
 Get Current Simulation Time. More...
 
void setSimulationMode (bool)
 Sets the mode to simulation mode. More...
 
void forward ()
 Forwards the simulation by 1 step. More...
 
void backward ()
 Backs the simulation by 1 step. More...
 

Detailed Description

Simulation holds the traffic details like PDUs, ports, etc.

Member Function Documentation

◆ backward()

void Simulation::backward ( )

Backs the simulation by 1 step.

◆ createFrameInstance()

FrameInstance Simulation::createFrameInstance ( Device  ,
TrafficType  ,
int  ,
QString   
)

Create FrameInstance to be sent from a device.

Parameters
ownerDevice,thedevice for which the frame instance is created
trafficType,thetype of traffic for the frame instance, see documentation for newFrameInstanceAdded event
color,rbgcolor code for the frame
dstStr,destinationip address in string format
Returns
FrameInstance, FrameInstance object

◆ createFrameInstanceCustomType()

FrameInstance Simulation::createFrameInstanceCustomType ( Device  ,
QString  ,
int  ,
QString   
)

Create FrameInstance to be sent from a device with a custom traffic type.

Parameters
ownerDevice,thedevice for which the frame instance is created
customTrafficType,thetype of traffic for the frame instance, see documentation for newFrameInstanceAdded event
color,rbgcolor code for the frame
dstStr,destinationip address in string format
Returns
FrameInstance, FrameInstance object

◆ createTimer()

SimulationTimer Simulation::createTimer ( int  ,
bool   
)

Create Simulation Timer.

Parameters
delay,delaytime before timer expires
bAddRandom,trueto set the timer to expire at random time and false to not including the random factor
Returns
SimulationTimer, SimulationTimer object

◆ createTimerUuid()

uuid Simulation::createTimerUuid ( int  ,
bool   
)

Create Simulation Timer and return the uuid of the timer object.

Parameters
delay,delaytime before timer expires
bAddRandom,trueto set the timer to expire at random time and false to not including the random factor
Returns
uuid, SimulationTimer object's uuid

◆ finalizeFrameInstance()

void Simulation::finalizeFrameInstance ( FrameInstance  )

Finalize frame instance.

Parameters
frameInstance,FrameInstanceobject

◆ forward()

void Simulation::forward ( )

Forwards the simulation by 1 step.

◆ forwardEnded()

void Simulation::forwardEnded ( )

This event is emitted when simulation playback is stopped.

IPC event.

◆ forwardStarted()

void Simulation::forwardStarted ( )

This event is emitted when simulation playback is started.

IPC event.

◆ getCurrentFrameInstanceIndex()

int Simulation::getCurrentFrameInstanceIndex ( )

Returns index of "current" frame instance.

◆ getCurrentSimTime()

long Simulation::getCurrentSimTime ( )

Get Current Simulation Time.

Returns
long, Current Simulation Time

◆ getFrameInstanceAt()

FrameInstance Simulation::getFrameInstanceAt ( int  )

Returns the FrameInstance at the specified index in the simulation event list.

Parameters
nodeIndex,theindex of FrameInstance of interest.
Returns
FrameInstance, the FrameInstance object at the specified index in the simulation event list.

◆ getFrameInstanceCount()

int Simulation::getFrameInstanceCount ( )

Returns the number of FrameInstances at present in the simulation.

Returns
int, the number of FrameInstances at present in the simulation.

◆ getIpcTimer()

SimulationTimer Simulation::getIpcTimer ( uuid  )

Get Simulation Timer based on uuid.

Parameters
uuid,uuidof the timer
Returns
SimulationTimer, SimulationTimer object

◆ isSimulationMode()

bool Simulation::isSimulationMode ( )

Returns true if in Simulation Mode, otherwise false.

Returns
bool, true if in Simulation Mode, otherwise false.

◆ newFrameInstanceAdded()

void Simulation::newFrameInstanceAdded ( TrafficType  ,
int   
)

This event is emitted when a new frame instance is added.

  • trafficType, the user traffic type. User traffic types: eTrafficType_Icmp = 0, eTrafficType_Tcp = 1, eTrafficType_Udp = 2, eTrafficType_RipV1 = 3, eTrafficType_RipV2 = 4, eTrafficType_Arp = 5, eTrafficType_Cdp = 6, eTrafficType_Dhcp = 7, eTrafficType_Nat = 8, eTrafficType_Eigrp = 9, eTrafficType_Vtp = 10, eTrafficType_Stp = 11, eTrafficType_Ospf = 12, eTrafficType_Dtp = 13, eTrafficType_Telnet = 14, eTrafficType_Ssh = 15, eTrafficType_Tftp = 16, eTrafficType_Http = 17, eTrafficType_Https = 18, eTrafficType_Dns = 19, eTrafficType_Icmpv6 = 20, eTrafficType_Lacp = 21, eTrafficType_Pagp = 22, eTrafficType_Ipsec = 23, eTrafficType_Ike = 24, eTrafficType_Syslog = 25, eTrafficType_Tacacs = 26, eTrafficType_Radius = 27, eTrafficType_Snmp = 28, eTrafficType_Ntp = 29, eTrafficType_Ftp = 30, eTrafficType_Smtp = 31, eTrafficType_Pop3 = 32, eTrafficType_Sccp = 33, eTrafficType_Rtp = 34, eTrafficType_H323 = 35, eTrafficType_Bgp = 36, eTrafficType_Hsrp = 37, eTrafficType_Hsrpv6 = 38, eTrafficType_Netflow = 39, eTrafficType_Ndv6 = 40, eTrafficType_Ripng = 41, eTrafficType_Dhcpv6 = 42, eTrafficType_Eigrpv6 = 43, eTrafficType_Ospfv6 = 44, eTrafficType_IoE = 45, eTrafficType_Ptp = 46, eTrafficType_Rep = 47, eTrafficType_CapwapUdp = 48, eTrafficType_Lldp = 49, eTrafficType_Span = 50, eTrafficType_IoETcp = 51, eTrafficType_Usb = 52, eTrafficType_Bluetooth = 53, eTrafficType_Custom = 1000
  • index, the index of the frame instance.

IPC event.

◆ resetSimulation()

void Simulation::resetSimulation ( )

Resets simulation and fires the event.

◆ setSimulationMode()

void Simulation::setSimulationMode ( bool  )

Sets the mode to simulation mode.

  • toSimMode, whether to change to simulation mode or not (realtime).

◆ simulationBufferFull()

void Simulation::simulationBufferFull ( )

IPC event.

◆ simulationModeChanged()

void Simulation::simulationModeChanged ( )

This event is emitted when the Realtime or Simulation Mode is changed.

IPC event.

◆ simulationReset()

void Simulation::simulationReset ( )

This event is emitted when the simulation is reset.

IPC event.


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