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

Acl holds and manipulates AclStatements. More...

Public Member Functions

bool addStatement (string)
 Adds an ACL statement to this ACL. More...
 
bool addExtStatement (bool, string, bool, string, string, int, string, string, int)
 Adds an ACL statement to this ACL with the specified parameters. More...
 
bool removeStatement (string)
 Removes an ACL statement from this ACL. More...
 
bool removeExtStatement (bool, string, bool, string, string, int, string, string, int)
 Removes the ACL statement from this ACL with the specified parameters. More...
 
AclStatement getStatementAt (int)
 Returns an ACL statement at the specified index. More...
 
int getStatementCount ()
 Returns the number of ACL statements. More...
 
void addRemark (string)
 Adds a remark to this ACL. More...
 
string getRemark (int)
 Returns the remark at the specified index. More...
 
int getRemarkCount ()
 Returns the number of remarks in this ACL. More...
 
int getCommandCount ()
 Returns the number of ACL commands. More...
 
string getCommandAt (int)
 Returns the ACL command at the specified index. More...
 
bool isExtended ()
 Returns true if this ACL is an extended ACL, false if it is a standard ACL. More...
 
string getAclId ()
 Returns this ACL's ID. More...
 
vector< string > getExtStatementDataAt (bool, int)
 Returns a vector of the data of the ACL statement at the specified index. More...
 
bool evaluate (QString)
 Evaluates the ACL against a packet/PDU, and returns true if permitted, false otherwise. More...
 
AclStatement getMatch (QString)
 Evaluates the ACL against a packet/PDU, and returns the matched AclStatement. More...
 

Detailed Description

Acl holds and manipulates AclStatements.

Member Function Documentation

◆ addExtStatement()

bool Acl::addExtStatement ( bool  ,
string  ,
bool  ,
string  ,
string  ,
int  ,
string  ,
string  ,
int   
)

Adds an ACL statement to this ACL with the specified parameters.

Parameters
protocol,validprotocols are IP, ICMP, TCP, and UDP.
remoteIp,theremote IP adddress.
remoteMask,theremote wildcard mask.
remotePort,theremote port for TCP and UDP.
localIp,thelocal IP address.
localMask,thelocal wildcard mask.
localPort,thelocal port for TCP and UDP.
Returns
bool, true if added successfully, otherwise false.

◆ addRemark()

void Acl::addRemark ( string  )

Adds a remark to this ACL.

Parameters
remark,theremark to be added.

◆ addStatement()

bool Acl::addStatement ( string  )

Adds an ACL statement to this ACL.

Parameters
statement,theIOS ACL statement. "access-list [this-aclid]" should be omitted. Start with "permit, deny, or remark".
Returns
bool, true if added successfully, otherwise false.

◆ evaluate()

bool Acl::evaluate ( QString  )

Evaluates the ACL against a packet/PDU, and returns true if permitted, false otherwise.

Parameters
jsonPdu,thePDU in JSON serialized format
Returns
bool, true if permitted, false otherwise

◆ getAclId()

string Acl::getAclId ( )

Returns this ACL's ID.

Returns
string, this ACL's ID.

◆ getCommandAt()

string Acl::getCommandAt ( int  )

Returns the ACL command at the specified index.

Parameters
intindex, the index of the ACL command.
Returns
string, the ACL command at the specified index.

◆ getCommandCount()

int Acl::getCommandCount ( )

Returns the number of ACL commands.

Returns
int, the number of ACL commands.

◆ getExtStatementDataAt()

vector< string > Acl::getExtStatementDataAt ( bool  ,
int   
)

Returns a vector of the data of the ACL statement at the specified index.

Parameters
index,theindex of the ACL statement of interest.
Returns
vector<string>, a vector of the data of the ACL statement at the specified index.

◆ getMatch()

AclStatement Acl::getMatch ( QString  )

Evaluates the ACL against a packet/PDU, and returns the matched AclStatement.

Parameters
jsonPdu,thePDU in JSON serialized format
Returns
AclStatement, the matched statement, or null if no match

◆ getRemark()

string Acl::getRemark ( int  )

Returns the remark at the specified index.

Parameters
index,theindex of the remark.
Returns
string, the remark at the specified index.

◆ getRemarkCount()

int Acl::getRemarkCount ( )

Returns the number of remarks in this ACL.

Returns
int, the number of remarks in this ACL.

◆ getStatementAt()

AclStatement Acl::getStatementAt ( int  )

Returns an ACL statement at the specified index.

Parameters
index,theindex of the ACL statement.
Returns
AclStatement, the ACL statement at the specified index.

◆ getStatementCount()

int Acl::getStatementCount ( )

Returns the number of ACL statements.

Returns
int, the number of ACL statements.

◆ isExtended()

bool Acl::isExtended ( )

Returns true if this ACL is an extended ACL, false if it is a standard ACL.

Returns
bool, true if this ACL is an extended ACL, false if it is a standard ACL.

◆ removeExtStatement()

bool Acl::removeExtStatement ( bool  ,
string  ,
bool  ,
string  ,
string  ,
int  ,
string  ,
string  ,
int   
)

Removes the ACL statement from this ACL with the specified parameters.

Parameters
protocol,validprotocols are IP, ICMP, TCP, and UDP.
remoteIp,theremote IP adddress.
remoteMask,theremote wildcard mask.
remotePort,theremote port for TCP and UDP.
localIp,thelocal IP address.
localMask,thelocal wildcard mask.
localPort,thelocal port for TCP and UDP.
Returns
bool, true if removed successfully, otherwise false.

◆ removeStatement()

bool Acl::removeStatement ( string  )

Removes an ACL statement from this ACL.

Parameters
statementthe IOS ACL statement. "access-list [this-aclid]" should be omitted. Start with "permit, deny, or remark".
Returns
bool, true if removed successfully, otherwise false.

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