![]() |
GetAnswer() |
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Public Function |
Declared in: DNSAnswers.h |
std::string GetAnswer() const;
First answer data (if you expect many answers, request it with the vector)
try { //Do we have an answer ? if (!m_aDNSHeader.usANCount || m_aAnswers.empty()) return ""; //Get the answer const CDNSAnswer& rAnswer=m_aAnswers[0]; //Check what type is it ? if (rAnswer.GetResourceType()==CDNSQuery::PTR || rAnswer.GetResourceType()==CDNSQuery::MX) { //Get the data std::string sData; sData=rAnswer.GetData(); //Convert it to long return sData; } else if (rAnswer.GetResourceType()==CDNSQuery::A) { //Get the data std::string sData; sData=rAnswer.GetData(); //Convert to DWORD DWORD dwIP; dwIP=atof(sData.c_str()); //Convert to string return CSpoofBase::LongToStdString(dwIP); } else return ""; } ERROR_HANDLER_RETURN("GetAnswer","")
![]() |
Site content copyright © 2003 Komodia LTD.. See the About page for additional notices. This page last updated: 24 Feb 2003. |