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

SnmpAgent holds and manipulates the SNMP agent. More...

Inheritance diagram for SnmpAgent:
Process

Public Member Functions

pair< string, Access > getCommunity (string)
 Returns the community with the specified name. More...
 
pair< string, Access > getCommunityAt (int)
 Returns the community at the specified name. More...
 
bool removeCommunity (string)
 Removes the specified community. More...
 
void addCommunity (string, Access)
 Adds a community. More...
 
int getCommunityCount ()
 Returns the number of communities. More...
 
bool isEnabled ()
 Returns true if the SNMP agent is enabled, otherwise false. More...
 
void setEnabled (bool)
 Enables or disables the SNMP agent. More...
 
- Public Member Functions inherited from Process
Device getOwnerDevice ()
 Returns the device for this process. More...
 

Detailed Description

SnmpAgent holds and manipulates the SNMP agent.

Member Function Documentation

◆ addCommunity()

void SnmpAgent::addCommunity ( string  ,
Access   
)

Adds a community.

Parameters
communityStr,thename of the community.
access,thecommunity name and access privileges. Access privileges: eAccess_ReadOnly = 0, eAccess_ReadWrite = 1, eAccess_ReadCreate = 2, eAccess_NotAccessible = 3
Returns
bool, true if successful, otherwise false.

◆ getCommunity()

pair< string, Access > SnmpAgent::getCommunity ( string  )

Returns the community with the specified name.

Parameters
community,thename of the community of interest.
Returns
pair<string, enum<Access>, the community name and access privileges. Access privileges: eAccess_ReadOnly = 0, eAccess_ReadWrite = 1, eAccess_ReadCreate = 2, eAccess_NotAccessible = 3

◆ getCommunityAt()

pair< string, Access > SnmpAgent::getCommunityAt ( int  )

Returns the community at the specified name.

Parameters
index,theindex of the community of interest.
Returns
pair<string, enum<Access>, the community name and access privileges. Access privileges: eAccess_ReadOnly = 0, eAccess_ReadWrite = 1, eAccess_ReadCreate = 2, eAccess_NotAccessible = 3

◆ getCommunityCount()

int SnmpAgent::getCommunityCount ( )

Returns the number of communities.

Returns
int, the number of communities.

◆ isEnabled()

bool SnmpAgent::isEnabled ( )

Returns true if the SNMP agent is enabled, otherwise false.

Returns
bool, true if the SNMP agent is enabled, otherwise false.

◆ removeCommunity()

bool SnmpAgent::removeCommunity ( string  )

Removes the specified community.

Parameters
communityStr,thename of the community of interest.
Returns
bool, true if successful, otherwise false.

◆ setEnabled()

void SnmpAgent::setEnabled ( bool  )

Enables or disables the SNMP agent.

Returns
enabled, true to enable the SNMP agent, false to disable it.

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