![]() |
GetAddress() |
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Public Function |
Declared in: DNSAnswers.h |
unsigned long GetAddress( unsigned short usIndex=0) const;
With all this data, just get the address
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)
![]() |
Site content copyright © 2003 Komodia LTD.. See the About page for additional notices. This page last updated: 24 Feb 2003. |