22 int SendAddrLen =
sizeof(SendAddr);
65 _tprintf(
_T(
"sendto() failed with WSANOTINITIALIZED\n") );
68 _tprintf(
_T(
"sendto() failed with WSAENETDOWN\n") );
71 _tprintf(
_T(
"sendto() failed with WSAEACCES\n") );
74 _tprintf(
_T(
"sendto() failed with WSAEINVAL\n") );
77 _tprintf(
_T(
"sendto() failed with WSAEINTR\n") );
80 _tprintf(
_T(
"sendto() failed with WSAEINPROGRESS\n") );
83 _tprintf(
_T(
"sendto() failed with WSAEFAULT\n") );
86 _tprintf(
_T(
"sendto() failed with WSAENETRESET\n") );
89 _tprintf(
_T(
"sendto() failed with WSAENOBUFS\n") );
92 _tprintf(
_T(
"sendto() failed with WSAENOTCONN\n") );
95 _tprintf(
_T(
"sendto() failed with WSAENOTSOCK\n") );
98 _tprintf(
_T(
"sendto() failed with WSAEOPNOTSUPP\n") );
101 _tprintf(
_T(
"sendto() failed with WSAESHUTDOWN\n") );
104 _tprintf(
_T(
"sendto() failed with WSAEWOULDBLOCK\n") );
107 _tprintf(
_T(
"sendto() failed with WSAEMSGSIZE\n") );
110 _tprintf(
_T(
"sendto() failed with WSAEHOSTUNREACH\n") );
113 _tprintf(
_T(
"sendto() failed with WSAECONNABORTED\n") );
116 _tprintf(
_T(
"sendto() failed with WSAECONNRESET\n") );
119 _tprintf(
_T(
"sendto() failed with WSAEADDRNOTAVAIL\n") );
122 _tprintf(
_T(
"sendto() failed with WSAEAFNOSUPPORT\n") );
125 _tprintf(
_T(
"sendto() failed with WSAEDESTADDRREQ\n") );
128 _tprintf(
_T(
"sendto() failed with WSAENETUNREACH\n") );
131 _tprintf(
_T(
"sendto() failed with WSAETIMEDOUT\n") );
134 _tprintf(
_T(
"sendto() failed with unknown error\n") );
157 _tprintf(
_T(
"recvfrom() failed with WSANOTINITIALIZED\n") );
160 _tprintf(
_T(
"recvfrom() failed with WSAENETDOWN\n") );
163 _tprintf(
_T(
"recvfrom() failed with WSAEACCES\n") );
166 _tprintf(
_T(
"recvfrom() failed with WSAEINVAL\n") );
169 _tprintf(
_T(
"recvfrom() failed with WSAEINTR\n") );
172 _tprintf(
_T(
"recvfrom() failed with WSAEINPROGRESS\n") );
175 _tprintf(
_T(
"recvfrom() failed with WSAEFAULT\n") );
178 _tprintf(
_T(
"recvfrom() failed with WSAENETRESET\n") );
181 _tprintf(
_T(
"recvfrom() failed with WSAENOBUFS\n") );
184 _tprintf(
_T(
"recvfrom() failed with WSAENOTCONN\n") );
187 _tprintf(
_T(
"recvfrom() failed with WSAENOTSOCK\n") );
190 _tprintf(
_T(
"recvfrom() failed with WSAEOPNOTSUPP\n") );
193 _tprintf(
_T(
"recvfrom() failed with WSAESHUTDOWN\n") );
196 _tprintf(
_T(
"recvfrom() failed with WSAEWOULDBLOCK\n") );
199 _tprintf(
_T(
"recvfrom() failed with WSAEMSGSIZE\n") );
202 _tprintf(
_T(
"recvfrom() failed with WSAEHOSTUNREACH\n") );
205 _tprintf(
_T(
"recvfrom() failed with WSAECONNABORTED\n") );
208 _tprintf(
_T(
"recvfrom() failed with WSAECONNRESET\n") );
211 _tprintf(
_T(
"recvfrom() failed with WSAEADDRNOTAVAIL\n") );
214 _tprintf(
_T(
"recvfrom() failed with WSAEAFNOSUPPORT\n") );
217 _tprintf(
_T(
"recvfrom() failed with WSAEDESTADDRREQ\n") );
220 _tprintf(
_T(
"recvfrom() failed with WSAENETUNREACH\n") );
223 _tprintf(
_T(
"recvfrom() failed with WSAETIMEDOUT\n") );
226 _tprintf(
_T(
"recvfrom() failed with unknown error\n") );
245 *pOutBufferLength =
j;
265 for( ;
i > 0;
i -= 1 )
if(
'.' == pIP[
i] )
break;
278 for( ;
i > 0;
i -= 1 )
if(
'.' == pIP[
i] )
break;
291 for( ;
i > 0;
i -= 1 )
if(
'.' == pIP[
i] )
break;
304 for( ;
i > 0;
i -= 1 );
314 int i = 0,
l = 0,
b = 0,
c = 1;
318 if(
l > 15 )
return FALSE;
322 for( ;
i <
l;
i += 1 )
324 if(
'.' == pInput[
i] )
336 if( (pInput[
i] <
'0') || (pInput[
i] >
'9') )
return FALSE;
351 int c = 0,
d = 0,
i = 0,
j = 0,
k = 0,
l = 0,
m = 0;
374 for(
j = 0;
j <
l;
j += 1 )
405 int c = 0,
l = 0,
i = 0,
v = 0;
445 UCHAR Header1, Header2;
446 USHORT NumQuestions, NumAnswers, NumAuthority, NumAdditional;
475 _tprintf(
_T(
" opcode = %s, id = %d, rcode = %s\n"),
481 if( Header1 & 0x01 )
_tprintf(
_T(
", want recursion") );
485 " authority records = %d, additional = %d\n\n"),
489 (
int)NumAdditional );
495 for(
k = 0;
k < NumQuestions;
k += 1 )
519 UCHAR Header1, Header2;
520 USHORT NumQuestions, NumAnswers, NumAuthority, NumAdditional;
524 int d = 0,
i = 0,
k = 0;
550 _tprintf(
_T(
" opcode = %s, id = %d, rcode = %s\n"),
556 if( Header1 & 0x01 )
_tprintf(
_T(
", want recursion") );
557 if( Header2 & 0x80 )
_tprintf(
_T(
", recursion avail.") );
560 _tprintf(
_T(
" questions = %d, answers = %d, "
561 "authority records = %d, additional = %d\n\n"),
565 (
int)NumAdditional );
571 for(
k = 0;
k < NumQuestions;
k += 1 )
593 for(
k = 0;
k < NumAnswers;
k += 1 )
615 _tprintf(
_T(
" type = %s, class = %s, dlen = %d\n"),
642 for(
k = 0;
k < NumAuthority;
k += 1 )
662 _tprintf(
_T(
" type = %s, class = %s, dlen = %d\n"),
706 for(
k = 0;
k < NumAdditional;
k += 1 )
726 _tprintf(
_T(
" type = %s, class = %s, dlen = %d\n"),
767 switch( RCode & 0x0F )
ULONG WSAAPI inet_addr(IN CONST CHAR FAR *cp)
USHORT ClassNametoClassID(PCHAR ClassName)
PCHAR TypeIDtoTypeName(USHORT TypeID)
int ExtractIP(PCHAR pBuffer, PCHAR pOutput, USHORT Offset)
BOOL SendRequest(PCHAR pInBuffer, ULONG InBufferLength, PCHAR pOutBuffer, PULONG pOutBufferLength)
PCHAR RCodeIDtoRCodeName(UCHAR RCode)
BOOL IsValidIP(PCHAR pInput)
void ReverseIP(PCHAR pIP, PCHAR pReturn)
PCHAR OpcodeIDtoOpcodeName(UCHAR Opcode)
void PrintDebug(PCHAR pBuffer, DWORD BufferLength)
int ExtractName(PCHAR pBuffer, PCHAR pOutput, USHORT Offset, UCHAR Limit)
USHORT TypeNametoTypeID(PCHAR TypeName)
PCHAR ClassIDtoClassName(USHORT ClassID)
void PrintD2(PCHAR pBuffer, DWORD BufferLength)
_ACRTIMP size_t __cdecl strlen(const char *)
_ACRTIMP int __cdecl strncmp(const char *, const char *, size_t)
INT WSAAPI recvfrom(IN SOCKET s, OUT CHAR FAR *buf, IN INT len, IN INT flags, OUT LPSOCKADDR from, IN OUT INT FAR *fromlen)
INT WSAAPI sendto(IN SOCKET s, IN CONST CHAR FAR *buf, IN INT len, IN INT flags, IN CONST struct sockaddr *to, IN INT tolen)
GLboolean GLboolean GLboolean b
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
_In_ PVOID _In_ ULONG Opcode
_In_ ULONG _In_ ULONG Offset
INT WSAAPI bind(IN SOCKET s, IN CONST struct sockaddr *name, IN INT namelen)
#define RtlZeroMemory(Destination, Length)
_Must_inspect_result_ _In_ WDFDEVICE _In_ DEVICE_REGISTRY_PROPERTY _In_ ULONG BufferLength
#define WSANOTINITIALISED
int PASCAL FAR WSAGetLastError(void)
_In_ LONG _In_ LONG Limit