Cisco Packet Tracer Extensions API 8.1.0
API for communication between Cisco Packet Tracer application and its extension applications and modules.
|
NetworkFile is the main system file for the application. It holds all the configurations for the engine as well as the UI. More...
Public Member Functions | |
QString | getSavedFilename () |
Returns the filename of the currently opened file. More... | |
QString | getVersion () |
Returns the version the current file was saved in. More... | |
QString | getNetworkDescription () |
Returns the network description of the current file. More... | |
void | setNetworkDescription (QString) |
Sets the network description for the current file. More... | |
Options | getOptions () |
Returns the option settings of the current file. More... | |
Network | getMainNetwork () |
Returns the network of the current file. More... | |
UserProfile | getUserProfile () |
Returns the user profile of the current file. More... | |
Simulation | getMainSimulation () |
Returns the simulation of the current file. More... | |
Workspace | getWorkspace () |
Returns the workspace of the current file. More... | |
ActivityScriptEngine | getActivityScriptEngine () |
Returns the activity script engine of the current file. More... | |
ActivityScriptEngine | getScriptEngine () |
Returns the script engine of the current file. More... | |
void | resetScriptEngine () |
Removes the current activity script engine and creates a new one. More... | |
bool | addScript (QString, QString) |
Adds a script to the activity file. More... | |
bool | addScriptFile (QString, QString) |
Adds the script contents to the activity file from a file path. More... | |
void | addDefaultScripts () |
Resets the scripts to the default scripts. More... | |
bool | removeScript (QString) |
Removes the specified script from the activity file hash. More... | |
QString | getScript (QString) |
Returns the content of the script with the specified ID. More... | |
vector< QString > | getScriptIDs () |
Returns the list of IDs currently in the system. More... | |
bool | addScriptDataStore (QString, QString) |
Adds script data store for persistent storage (e.g. constants, options, settings). More... | |
bool | removeScriptDataStore (QString) |
Removes the specified script data store for persistent storage (e.g. constants, options, settings). More... | |
QString | getScriptDataStore (QString) |
Returns the content of the specified script data store. More... | |
vector< QString > | getScriptDataStoreIDs () |
Returns the list of IDs of script data stores. More... | |
FilterSet | getFilterSet () |
Returns the engine filter set for simulation packets, what is filtered out. More... | |
bool | addCustomTrafficType (QString) |
Adds a custom traffic type. Returns true if successful, false otherwise. More... | |
bool | hasCustomTrafficType (QString) |
Returns whether a custom traffic type is already added. More... | |
bool | addCustomPduType (QString, QString) |
Adds a custom PDU type. Returns true if successful, false otherwise. More... | |
bool | hasCustomPduType (QString) |
Returns whether a custom PDU type is already added. More... | |
void | duplicateDevice (Device) |
Creates and stores a copy of the given device. More... | |
bool | isActivityFile () |
Returns whether this file is an activity file or regular network file. More... | |
NetworkFile is the main system file for the application. It holds all the configurations for the engine as well as the UI.
bool NetworkFile::addCustomPduType | ( | QString | , |
QString | |||
) |
Adds a custom PDU type. Returns true if successful, false otherwise.
customPduType,the | custom PDU type name. |
jsonDefinition,a | JSON string representing the definition of the PDU in the following format and must include the following: { "title": "My Protocol PDU", "units": "Bits", "unit_marks": [16], "width": 32, "fields": [{"value": "TYPE: {type}","size": 32}, {"value": "data: {data}","size": 32}] |
bool NetworkFile::addCustomTrafficType | ( | QString | ) |
Adds a custom traffic type. Returns true if successful, false otherwise.
void NetworkFile::addDefaultScripts | ( | ) |
Resets the scripts to the default scripts.
bool NetworkFile::addScript | ( | QString | , |
QString | |||
) |
Adds a script to the activity file.
id,the | ID (e.g. filename) of the the script. |
contents,the | content of the script. |
bool NetworkFile::addScriptDataStore | ( | QString | , |
QString | |||
) |
Adds script data store for persistent storage (e.g. constants, options, settings).
id,the | ID (e.g. name) of the data store. |
contents,the | content of the data store. |
bool NetworkFile::addScriptFile | ( | QString | , |
QString | |||
) |
Adds the script contents to the activity file from a file path.
id,the | ID (e.g. filename) of the the script. |
filename,the | path including the filename of the script. |
void NetworkFile::duplicateDevice | ( | Device | ) |
Creates and stores a copy of the given device.
device,device | to duplicate. |
ActivityScriptEngine NetworkFile::getActivityScriptEngine | ( | ) |
Returns the activity script engine of the current file.
FilterSet NetworkFile::getFilterSet | ( | ) |
Returns the engine filter set for simulation packets, what is filtered out.
Network NetworkFile::getMainNetwork | ( | ) |
Simulation NetworkFile::getMainSimulation | ( | ) |
Returns the simulation of the current file.
QString NetworkFile::getNetworkDescription | ( | ) |
Returns the network description of the current file.
Options NetworkFile::getOptions | ( | ) |
QString NetworkFile::getSavedFilename | ( | ) |
Returns the filename of the currently opened file.
QString NetworkFile::getScript | ( | QString | ) |
Returns the content of the script with the specified ID.
id,the | ID (e.g. filename) of the script. |
QString NetworkFile::getScriptDataStore | ( | QString | ) |
Returns the content of the specified script data store.
id,the | ID (e.g. name) of the data store of interest. |
vector< QString > NetworkFile::getScriptDataStoreIDs | ( | ) |
Returns the list of IDs of script data stores.
ActivityScriptEngine NetworkFile::getScriptEngine | ( | ) |
Returns the script engine of the current file.
vector< QString > NetworkFile::getScriptIDs | ( | ) |
Returns the list of IDs currently in the system.
UserProfile NetworkFile::getUserProfile | ( | ) |
Returns the user profile of the current file.
QString NetworkFile::getVersion | ( | ) |
Returns the version the current file was saved in.
Workspace NetworkFile::getWorkspace | ( | ) |
bool NetworkFile::hasCustomPduType | ( | QString | ) |
Returns whether a custom PDU type is already added.
bool NetworkFile::hasCustomTrafficType | ( | QString | ) |
Returns whether a custom traffic type is already added.
bool NetworkFile::isActivityFile | ( | ) |
Returns whether this file is an activity file or regular network file.
bool NetworkFile::removeScript | ( | QString | ) |
Removes the specified script from the activity file hash.
id,the | ID (e.g. filename) of the script. |
bool NetworkFile::removeScriptDataStore | ( | QString | ) |
Removes the specified script data store for persistent storage (e.g. constants, options, settings).
id,the | ID (e.g. name) of the data store of interest. |
void NetworkFile::resetScriptEngine | ( | ) |
Removes the current activity script engine and creates a new one.
void NetworkFile::setNetworkDescription | ( | QString | ) |
Sets the network description for the current file.
description,the | network description for the current file. |