![]() |
GetAddress() |
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
| Public Function |
Declared in: DNSAnswers.h |
Declaration
unsigned long GetAddress(
unsigned short usIndex=0) const;
DescriptionWith all this data, just get the address
Function Body
try
{
if (!m_aDNSHeader.usARCount ||
!m_aDNSHeader.usANCount)
{
//Report it
ReportError("GetAddress","No answers!");
//Exit
return 0;
}
//Get to the actual answer
unsigned short usPrior;
usPrior=m_aDNSHeader.usANCount+
m_aDNSHeader.usNSCount;
for (unsigned short usCounter=usIndex;
usCounter<m_aDNSHeader.usARCount-usIndex;
++usCounter)
if (m_aAnswers[usPrior+usCounter].GetResourceType()==CDNSQuery::A)
{
//Get the data
std::string sData;
sData=m_aAnswers[usPrior+usCounter].GetData();
//Convert it to long
return atol(sData.c_str());
}
//Nothing
return 0;
}
ERROR_HANDLER_RETURN("GetAddress",0)
See Also
This web site was generated
using Surveyor V4.50.811.1. Click
here
for more information. |
Site content copyright © 2003 Komodia LTD.. See the About page for additional notices. This page last updated: 24 Feb 2003. |