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

PrivilegeManager handles and manipulates privileges on routers and switches. More...

Inheritance diagram for PrivilegeManager:
Process

Public Member Functions

bool addCommand (string, string, bool, int)
 Adds the specified command to the specified mode at the specified privilege level. More...
 
bool removeCommand (string, string)
 Removes the specified command from the specified mode. More...
 
int getModeCount ()
 Returns the number of modes. More...
 
string getModeAt (int)
 Returns the mode at the specified index. More...
 
int getCommandForModeCount (string)
 Returns the number of commands for the specified mode. More...
 
pair< string, CommandPrivilegegetCommandForModeAt (string, int)
 Returns the command string and CommandPrivilege object in the specified mode at the specified index. More...
 
pair< string, CommandPrivilegegetCommandForMode (string, string)
 Returns the command string and CommandPrivilege object in the specified mode for the specified command. More...
 
bool isCommandAdded (string)
 Returns true if the command is already added, otherwise false. More...
 
- Public Member Functions inherited from Process
Device getOwnerDevice ()
 Returns the device for this process. More...
 

Detailed Description

PrivilegeManager handles and manipulates privileges on routers and switches.

Member Function Documentation

◆ addCommand()

bool PrivilegeManager::addCommand ( string  ,
string  ,
bool  ,
int   
)

Adds the specified command to the specified mode at the specified privilege level.

Parameters
mode,themode to add the command to. Valid modes: user, enable, global.
command,thecommand of interest.
bAll,trueto include all, false to not include all.
level,theprivilege level.
Returns
bool, true if successful, otherwise false.

◆ getCommandForMode()

pair< string, CommandPrivilege > PrivilegeManager::getCommandForMode ( string  ,
string   
)

Returns the command string and CommandPrivilege object in the specified mode for the specified command.

Parameters
mode,themode of interest. Valid modes: user, enable, global.
command,thecommand of interest.
Returns
pair<string, CommandPrivilege"CommandSet::SCommandPrivilege">, the command and CommandPrivilege object.

◆ getCommandForModeAt()

pair< string, CommandPrivilege > PrivilegeManager::getCommandForModeAt ( string  ,
int   
)

Returns the command string and CommandPrivilege object in the specified mode at the specified index.

Parameters
mode,themode of interest. Valid modes: user, enable, global.
index,theindex of the command of interest.
Returns
pair<string, CommandPrivilege"CommandSet::SCommandPrivilege">, the command and CommandPrivilege object.

◆ getCommandForModeCount()

int PrivilegeManager::getCommandForModeCount ( string  )

Returns the number of commands for the specified mode.

Parameters
mode,themode of interest. Valid modes: user, enable, global.
Returns
int, the number of commands for the specified mode.

◆ getModeAt()

string PrivilegeManager::getModeAt ( int  )

Returns the mode at the specified index.

Parameters
index,theindex of the mode of interest.
Returns
string, the mode at the specified index.

◆ getModeCount()

int PrivilegeManager::getModeCount ( )

Returns the number of modes.

Returns
int, the number of modes.

◆ isCommandAdded()

bool PrivilegeManager::isCommandAdded ( string  )

Returns true if the command is already added, otherwise false.

Parameters
commandStr,commandstring to check for.
Returns
bool, true if the command is already added, otherwise false.

◆ removeCommand()

bool PrivilegeManager::removeCommand ( string  ,
string   
)

Removes the specified command from the specified mode.

Parameters
mode,themode to add the command to. Valid modes: user, enable, global.
command,thecommand of interest.
Returns
bool, true if successful, otherwise false.

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