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

DnsServerProcess is the process that stores DNS records and resolves domain names and hostnames into IP addresses. More...

Inheritance diagram for DnsServerProcess:
Process

Public Member Functions

bool addIpAddress (string, ip)
 Adds a DNS record with the specified hostname and IP address. More...
 
void removeIpAddress (string)
 Removes the DNS record with the associated hostname. More...
 
pair< string, ip > getEntryAt (int)
 
int getEntryCount ()
 Returns the number of DNS records. More...
 
bool isValidName (string)
 Returns true if the specified hostname is a valid name (non-special characters), otherwise false. More...
 
void setEnable (bool)
 Enables or disables the DNS server process. More...
 
bool isEnabled ()
 Returns true if the DNS server process is enabled, otherwise false. More...
 
void setPortNumber (int)
 Sets the port number of the DNS service. More...
 
int getPortNumber ()
 Returns the port number of the DNS service. More...
 
bool isDomainNameExisted (string)
 Returns true if the specified domain name exists, otherwise false. More...
 
ip getIpAddOfDomain (string)
 Returns the IP address of the specified domain name. More...
 
DnsRrA getARecordWithAddress (string, ip)
 Returns the A resource record with the specified parameters. More...
 
DnsRrCname getCNameRecordWithHostname (string, string)
 Returns the CNAME resource record with the specified parameters. More...
 
DnsRrSoa getSOARecordWithMailbox (string, string)
 Returns the SOA resource record with the specified parameters. More...
 
DnsRrNs getNSRecordWithServerName (string, string)
 Returns the NS resource record with the specified parameters. More...
 
bool addARecordToNameServerDb (string, string)
 Returns true if the A resource record was added successfully, otherwise false. More...
 
bool addCNAMEToNameServerDb (string, string)
 Returns true if the CNAME resource record was added successfully, otherwise false. More...
 
bool addSOAToNameServerDb (string, string, string, string, string, string, string)
 Returns true if the SOA resource record was added successfully, otherwise false. More...
 
bool addNSRecordToNameServerDb (string, string)
 Returns true if the NS resource record was added successfully, otherwise false. More...
 
bool removeARecordFromNameServerDb (string, string)
 Returns true if the specified A resource record was removed successfully, otherwise false. More...
 
bool removeCNAMEFromNameServerDb (string, string)
 Returns true if the specified CNAME resource record was removed successfully, otherwise false. More...
 
bool removeSOAFromNameServerDb (string, string)
 Returns true if the specified SOA resource record was removed successfully, otherwise false. More...
 
bool removeNSRecordFromNameServerDb (string, string)
 Returns true if the specified NS resource record was removed successfully, otherwise false. More...
 
int getSizeOfNameServerDb ()
 Returns the size of the name server database. More...
 
DnsResourceRecord getRrFromNameServerDbAt (int)
 Returns the resource record at the specified index. More...
 
vector< DnsResourceRecordgetMatchingRRsFromCache (string)
 Returns the resource record associated with the resource record name. More...
 
- Public Member Functions inherited from Process
Device getOwnerDevice ()
 Returns the device for this process. More...
 

Detailed Description

DnsServerProcess is the process that stores DNS records and resolves domain names and hostnames into IP addresses.

Member Function Documentation

◆ addARecordToNameServerDb()

bool DnsServerProcess::addARecordToNameServerDb ( string  ,
string   
)

Returns true if the A resource record was added successfully, otherwise false.

Parameters
domainName,thedomain name for the A resource record.
address,theaddress for the A resource record.
Returns
bool, true if the A resource record was added successfully, otherwise false.

◆ addCNAMEToNameServerDb()

bool DnsServerProcess::addCNAMEToNameServerDb ( string  ,
string   
)

Returns true if the CNAME resource record was added successfully, otherwise false.

Parameters
domainName,thedomain name for the CNAME resource record.
hostName,thehostname for the CNAME resource record.
Returns
bool, true if the CNAME resource record was added successfully, otherwise false.

◆ addIpAddress()

bool DnsServerProcess::addIpAddress ( string  ,
ip   
)

Adds a DNS record with the specified hostname and IP address.

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

◆ addNSRecordToNameServerDb()

bool DnsServerProcess::addNSRecordToNameServerDb ( string  ,
string   
)

Returns true if the NS resource record was added successfully, otherwise false.

Parameters
domainName,thedomain name for the NS resource record.
serverName,theserver name for the NS resource record.
Returns
bool, true if the NS record was added successfully, otherwise false.

◆ addSOAToNameServerDb()

bool DnsServerProcess::addSOAToNameServerDb ( string  ,
string  ,
string  ,
string  ,
string  ,
string  ,
string   
)

Returns true if the SOA resource record was added successfully, otherwise false.

Parameters
domainName,thedomain name for the SOA resource record.
serverName,theprimary server name for the SOA resource record.
mailbox,themailbox for the SOA resource record.
minTtl,theminimum TTL for the SOA resource record.
refresh,therefresh time for the SOA resource record.
retry,theretry time for the SOA resource record.
expiry,theexpiry time for the SOA resource record.
Returns
bool, true if the CNAME resource record was added successfully, otherwise false.

◆ getARecordWithAddress()

DnsRrA DnsServerProcess::getARecordWithAddress ( string  ,
ip   
)

Returns the A resource record with the specified parameters.

Parameters
domainName,thedomain name of the A resource record of interest.
address,theaddress of the A resource record of interest.
Returns
DnsRrA, the A resource record object with the specified parameters.

◆ getCNameRecordWithHostname()

DnsRrCname DnsServerProcess::getCNameRecordWithHostname ( string  ,
string   
)

Returns the CNAME resource record with the specified parameters.

Parameters
domainName,thedomain name of the CNAME resource record of interest.
hostName,thehostname of the CNAME resource record of interest.
Returns
DnsRrCname, the CNAME resource record object with the specified parameters.

◆ getEntryAt()

pair< string, ip > DnsServerProcess::getEntryAt ( int  )

\Returns the hostname and IP address of the DNS record at the specified index.

Parameters
index,theDNS record index of interest.
Returns
pair<string, ip>, the hostname and IP address of the DNS record at the specified index.

◆ getEntryCount()

int DnsServerProcess::getEntryCount ( )

Returns the number of DNS records.

Returns
int, the number of DNS records.

◆ getIpAddOfDomain()

ip DnsServerProcess::getIpAddOfDomain ( string  )

Returns the IP address of the specified domain name.

Parameters
domainName,thedomain name of interest.
Returns
ip, the IP address of the specified domain name.

◆ getMatchingRRsFromCache()

vector< DnsResourceRecord > DnsServerProcess::getMatchingRRsFromCache ( string  )

Returns the resource record associated with the resource record name.

Parameters
name,thename of the resource record of interest.
Returns
DnsResourceRecord, the resource record DnsResourceRecord object associated with the resource record name.

◆ getNSRecordWithServerName()

DnsRrNs DnsServerProcess::getNSRecordWithServerName ( string  ,
string   
)

Returns the NS resource record with the specified parameters.

Parameters
domainName,thedomain name of the NS resource record of interest.
serverName,theserver name of the NS resource record of interest.
Returns
DnsRrNs, the NS resource record object with the specified parameters.

◆ getPortNumber()

int DnsServerProcess::getPortNumber ( )

Returns the port number of the DNS service.

Returns
int, the port number of the DNS service.

◆ getRrFromNameServerDbAt()

DnsResourceRecord DnsServerProcess::getRrFromNameServerDbAt ( int  )

Returns the resource record at the specified index.

Parameters
index,theindex of the resource record of interest.
Returns
DnsResourceRecord, the resource record DnsResourceRecord object at the specified index.

◆ getSizeOfNameServerDb()

int DnsServerProcess::getSizeOfNameServerDb ( )

Returns the size of the name server database.

Returns
int, the size of the name server database.

◆ getSOARecordWithMailbox()

DnsRrSoa DnsServerProcess::getSOARecordWithMailbox ( string  ,
string   
)

Returns the SOA resource record with the specified parameters.

Parameters
domainName,thedomain name of the SOA resource record of interest.
mailbox,themailbox of the SOA resource record of interest.
Returns
DnsRrSoa, the SOA resource record object with the specified parameters.

◆ isDomainNameExisted()

bool DnsServerProcess::isDomainNameExisted ( string  )

Returns true if the specified domain name exists, otherwise false.

Parameters
domainName,thedomain name of interest.
Returns
bool, true if the specified domain name exists, otherwise false.

◆ isEnabled()

bool DnsServerProcess::isEnabled ( )

Returns true if the DNS server process is enabled, otherwise false.

Returns
bool, true if the DNS server process is enabled, otherwise false.

◆ isValidName()

bool DnsServerProcess::isValidName ( string  )

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

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

◆ removeARecordFromNameServerDb()

bool DnsServerProcess::removeARecordFromNameServerDb ( string  ,
string   
)

Returns true if the specified A resource record was removed successfully, otherwise false.

Parameters
domainName,thedomain name of the A resource record of interest.
address,theaddress of the A resource record of interest.
Returns
bool, true if the specified A resource record was removed successfully, otherwise false.

◆ removeCNAMEFromNameServerDb()

bool DnsServerProcess::removeCNAMEFromNameServerDb ( string  ,
string   
)

Returns true if the specified CNAME resource record was removed successfully, otherwise false.

Parameters
domainName,thedomain name of the CNAME resource record of interest.
hostName,thehostname of the CNAME resource record of interest.
Returns
bool, true if the specified CNAME resource record was removed successfully, otherwise false.

◆ removeIpAddress()

void DnsServerProcess::removeIpAddress ( string  )

Removes the DNS record with the associated hostname.

Parameters
hostname,thehostname of the DNS record of interest.

◆ removeNSRecordFromNameServerDb()

bool DnsServerProcess::removeNSRecordFromNameServerDb ( string  ,
string   
)

Returns true if the specified NS resource record was removed successfully, otherwise false.

Parameters
domainName,thedomain name of the NS resource record of interest.
serverName,theserver name of the NS resource record of interest.
Returns
bool, true if the specified NS resource record was removed successfully, otherwise false.

◆ removeSOAFromNameServerDb()

bool DnsServerProcess::removeSOAFromNameServerDb ( string  ,
string   
)

Returns true if the specified SOA resource record was removed successfully, otherwise false.

Parameters
domainName,thedomain name of the SOA resource record of interest.
mailbox,themailbox of the SOA resource record of interest.
Returns
bool, true if the specified SOA resource record was removed successfully, otherwise false.

◆ setEnable()

void DnsServerProcess::setEnable ( bool  )

Enables or disables the DNS server process.

Parameters
bEnable,trueto enable the DNS server process, false to disable it.

◆ setPortNumber()

void DnsServerProcess::setPortNumber ( int  )

Sets the port number of the DNS service.

Parameters
num,theport number to set the DNS service to.

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