![]() |
Parse() |
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
| Public Function |
Declared in: DNSAnswers.h |
Declaration
int Parse(
const char *pBuffer,
int iLength);
DescriptionParse the answers
Function Body
try
{
//Delete previous data
UnInitialize();
if (iLength<=DnsHeaderHeaderLength)
{
//Report it
ReportError("Parse","Buffer size too small!");
//Exit
return 0;
}
//Start parsing the dude
const char* pBackupBuffer=pBuffer;
//Let's start with the answer
memcpy(&m_aDNSHeader,
pBackupBuffer,
DnsHeaderHeaderLength);
//Reverse the header
ReverseHeader();
//Increase the buffer
pBackupBuffer+=DnsHeaderHeaderLength;
//OK now we can continue
m_pDNSQuery=new CDNSQuery;
//Get the number of data the query parsed !
unsigned short usParseLength;
//Parse it
usParseLength=m_pDNSQuery->Parse(pBackupBuffer,
m_aDNSHeader.usQDCount);
//Check for errors
if (!usParseLength)
{
//Report it
ReportError("Parse","Received zero length!");
//Exit
return 0;
}
//Increase the buffer
pBackupBuffer+=usParseLength;
//Parse the rest of the headers
return ParseAnswers(pBackupBuffer,
pBuffer);
}
ERROR_HANDLER_RETURN("Parse",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. |