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

DnsClient is the process that handles retrieving DNS lookups. More...

Inheritance diagram for DnsClient:
Process

Public Member Functions

bool addIpAddress (string, ip)
 Adds a DNS entry with the specified hostname and IP address to the DNS table. More...
 
void removeIpAddress (string)
 Removes the DNS entry from the table based on the hostname. More...
 
void removeIp (string, ip)
 Removes the DNS entry from the table based on the hostname and the IP address. More...
 
bool isValidName (string)
 
void setServerIp (ip)
 Sets the IP address of the DNS server. More...
 
ip getServerIp ()
 Returns the IP address of the DNS server. More...
 
ipv6 getServerIpv6 () const
 Returns the IPv6 address of the DNS server. More...
 
void setServerIpv6 (ipv6)
 Sets the IPv6 address of the DNS server. More...
 
void setEnabled (bool)
 Enable or disable Dns Client Process. More...
 
bool isEnabled ()
 Returns true if this DNS client process is enabled, otherwise false. More...
 
int getStrToIpCount ()
 Returns the number of DNS entries in the DNS table. More...
 
string getHostAt (int)
 Returns the hostname at the specified index. More...
 
bool isHostNameExisted (string)
 Returns true if the hostname exists in the DNS table, otherwise false. More...
 
bool isIpExisted (string, ip)
 Returns true if the hostname and IP address DNS entry exists, otherwise false. More...
 
vector< ip > getIpOfHost (string)
 Returns a list of IP addresses associated with the specified hostname. More...
 
- Public Member Functions inherited from Process
Device getOwnerDevice ()
 Returns the device for this process. More...
 

Detailed Description

DnsClient is the process that handles retrieving DNS lookups.

Member Function Documentation

◆ addIpAddress()

bool DnsClient::addIpAddress ( string  ,
ip   
)

Adds a DNS entry with the specified hostname and IP address to the DNS table.

Parameters
hostname,thehostname of the node.
ipAddress,theIP address of the node.
Returns
bool, true if successful, otherwise false.

◆ getHostAt()

string DnsClient::getHostAt ( int  )

Returns the hostname at the specified index.

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

◆ getIpOfHost()

vector< ip > DnsClient::getIpOfHost ( string  )

Returns a list of IP addresses associated with the specified hostname.

Parameters
hostname,thehostname of interest.
Returns
vector<ip>, the list of IP addresses associated with the specified hostname.

◆ getServerIp()

ip DnsClient::getServerIp ( )

Returns the IP address of the DNS server.

Returns
ip, the DNS server ip address.

◆ getServerIpv6()

ipv6 DnsClient::getServerIpv6 ( ) const

Returns the IPv6 address of the DNS server.

Returns
ipv6, the DNS server ipv6 address.

◆ getStrToIpCount()

int DnsClient::getStrToIpCount ( )

Returns the number of DNS entries in the DNS table.

Returns
int, the number of DNS entries in the DNS table.

◆ isEnabled()

bool DnsClient::isEnabled ( )

Returns true if this DNS client process is enabled, otherwise false.

Returns
bool, true if this DNS client process is enabled, otherwise false.

◆ isHostNameExisted()

bool DnsClient::isHostNameExisted ( string  )

Returns true if the hostname exists in the DNS table, otherwise false.

Parameters
hostname,thehostname of interest.
Returns
bool, true if the hostname exists in the DNS table, otherwise false.

◆ isIpExisted()

bool DnsClient::isIpExisted ( string  ,
ip   
)

Returns true if the hostname and IP address DNS entry exists, otherwise false.

Parameters
hostname,thehostname to lookup.
ipAddress,theIP address to lookup.
Returns
bool, true if the hostname and IP address entry exists, otherwise false.

◆ isValidName()

bool DnsClient::isValidName ( string  )

Returns true if the hostname is a valid name (non-special characters), otherwise false.

Parameters
hostname,thehostname of interest.
Returns
bool, true if the hostname is a valid name (non-special characters), otherwise false.

◆ removeIp()

void DnsClient::removeIp ( string  ,
ip   
)

Removes the DNS entry from the table based on the hostname and the IP address.

Parameters
hostname,thehostname of the node.
ipAddress,theIP address of the node.

◆ removeIpAddress()

void DnsClient::removeIpAddress ( string  )

Removes the DNS entry from the table based on the hostname.

Parameters
hostname,thehostname associated with the IP address to remove.

◆ setEnabled()

void DnsClient::setEnabled ( bool  )

Enable or disable Dns Client Process.

Parameters
bEnable,trueto enable, otherwise false.

◆ setServerIp()

void DnsClient::setServerIp ( ip  )

Sets the IP address of the DNS server.

Parameters
ipAddress,theDNS server IP address.

◆ setServerIpv6()

void DnsClient::setServerIpv6 ( ipv6  )

Sets the IPv6 address of the DNS server.

Parameters
ipAddress,theDNS server IPv6 address.

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