ReactOS  0.4.12-dev-57-g7050ac4
nslookup.h
Go to the documentation of this file.
1 #ifndef _NSLOOKUP_H
2 #define _NSLOOKUP_H
3 
4 #include <stdarg.h>
5 
6 #define WIN32_NO_STATUS
7 #include <windef.h>
8 #define _INC_WINDOWS
9 #include <winsock2.h>
10 #include <tchar.h>
11 #include <stdio.h>
12 
13 #define TypeA "A"
14 #define TypeAAAA "AAAA"
15 #define TypeBoth "A+AAAA"
16 #define TypeAny "ANY"
17 #define TypeCNAME "CNAME"
18 #define TypeMX "MX"
19 #define TypeNS "NS"
20 #define TypePTR "PTR"
21 #define TypeSOA "SOA"
22 #define TypeSRV "SRV"
23 
24 #define TYPE_A 0x01
25 #define TYPE_NS 0x02
26 #define TYPE_CNAME 0x05
27 #define TYPE_SOA 0x06
28 #define TYPE_WKS 0x0B
29 #define TYPE_PTR 0x0C
30 #define TYPE_MX 0x0F
31 #define TYPE_ANY 0xFF
32 
33 #define ClassIN "IN"
34 #define ClassAny "ANY"
35 
36 #define CLASS_IN 0x01
37 #define CLASS_ANY 0xFF
38 
39 #define OPCODE_QUERY 0x00
40 #define OPCODE_IQUERY 0x01
41 #define OPCODE_STATUS 0x02
42 
43 #define OpcodeQuery "QUERY"
44 #define OpcodeIQuery "IQUERY"
45 #define OpcodeStatus "STATUS"
46 #define OpcodeReserved "RESERVED"
47 
48 #define RCODE_NOERROR 0x00
49 #define RCODE_FORMERR 0x01
50 #define RCODE_FAILURE 0x02
51 #define RCODE_NXDOMAIN 0x03
52 #define RCODE_NOTIMP 0x04
53 #define RCODE_REFUSED 0x05
54 
55 #define RCodeNOERROR "NOERROR"
56 #define RCodeFORMERR "FORMERR"
57 #define RCodeFAILURE "FAILURE"
58 #define RCodeNXDOMAIN "NXDOMAIN"
59 #define RCodeNOTIMP "NOTIMP"
60 #define RCodeREFUSED "REFUSED"
61 #define RCodeReserved "RESERVED"
62 
63 #define DEFAULT_ROOT "A.ROOT-SERVERS.NET."
64 #define ARPA_SIG ".in-addr.arpa"
65 
66 typedef struct _STATE
67 {
76  CHAR domain[256];
77  CHAR srchlist[6][256];
78  CHAR root[256];
87 } STATE, *PSTATE;
88 
89 /* nslookup.c */
90 
91 extern STATE State;
92 extern HANDLE ProcessHeap;
93 
94 /* utility.c */
95 
96 BOOL SendRequest( PCHAR pInBuffer,
97  ULONG InBufferLength,
98  PCHAR pOutBuffer,
99  PULONG pOutBufferLength );
100 
102  PCHAR pOutput,
103  USHORT Offset,
104  UCHAR Limit );
105 
106 void ReverseIP( PCHAR pIP, PCHAR pReturn );
107 BOOL IsValidIP( PCHAR pInput );
108 int ExtractIP( PCHAR pBuffer, PCHAR pOutput, USHORT Offset );
113 PCHAR TypeIDtoTypeName( USHORT TypeID );
114 USHORT TypeNametoTypeID( PCHAR TypeName );
115 PCHAR ClassIDtoClassName( USHORT ClassID );
116 USHORT ClassNametoClassID( PCHAR ClassName );
117 
118 #endif /* _NSLOOKUP_H */
signed char * PCHAR
Definition: retypes.h:7
BOOL vc
Definition: nslookup.h:73
void ReverseIP(PCHAR pIP, PCHAR pReturn)
Definition: utility.c:249
_In_ PVOID _In_ ULONG Opcode
Definition: hubbusif.h:330
Definition: userinit.h:56
BOOL ignoretc
Definition: nslookup.h:74
BOOL defname
Definition: nslookup.h:69
char CHAR
Definition: xmlstorage.h:175
void PrintD2(PCHAR pBuffer, DWORD BufferLength)
Definition: utility.c:436
HANDLE ProcessHeap
Definition: servman.c:15
PCHAR Class
Definition: nslookup.h:83
CHAR srchlist[6][256]
Definition: nslookup.h:77
BOOL search
Definition: nslookup.h:72
CHAR DefaultServerAddress[16]
Definition: nslookup.h:86
_In_ ULONG _In_ ULONG Offset
Definition: ntddpcm.h:101
_In_ ULONG BufferLength
Definition: usbdlib.h:225
PVOID pBuffer
struct _STATE * PSTATE
DWORD timeout
Definition: nslookup.h:80
void PrintDebug(PCHAR pBuffer, DWORD BufferLength)
Definition: utility.c:510
unsigned int BOOL
Definition: ntddk_ex.h:94
PCHAR OpcodeIDtoOpcodeName(UCHAR Opcode)
Definition: utility.c:741
DWORD retry
Definition: nslookup.h:79
USHORT TypeNametoTypeID(PCHAR TypeName)
Definition: utility.c:819
unsigned long DWORD
Definition: ntddk_ex.h:95
int ExtractName(PCHAR pBuffer, PCHAR pOutput, USHORT Offset, UCHAR Limit)
Definition: utility.c:343
BOOL MSxfr
Definition: nslookup.h:75
unsigned char UCHAR
Definition: xmlstorage.h:181
BOOL recurse
Definition: nslookup.h:71
CHAR domain[256]
Definition: nslookup.h:76
USHORT ClassNametoClassID(PCHAR ClassName)
Definition: utility.c:848
USHORT port
Definition: nslookup.h:84
unsigned short USHORT
Definition: pedump.c:61
struct _STATE STATE
PCHAR type
Definition: nslookup.h:82
unsigned int * PULONG
Definition: retypes.h:1
BOOL d2
Definition: nslookup.h:70
int ExtractIP(PCHAR pBuffer, PCHAR pOutput, USHORT Offset)
Definition: utility.c:397
PCHAR RCodeIDtoRCodeName(UCHAR RCode)
Definition: utility.c:759
BOOL IsValidIP(PCHAR pInput)
Definition: utility.c:306
STATE State
Definition: nslookup.c:14
unsigned int ULONG
Definition: retypes.h:1
PCHAR TypeIDtoTypeName(USHORT TypeID)
Definition: utility.c:786
BOOL debug
Definition: nslookup.h:68
BOOL SendRequest(PCHAR pInBuffer, ULONG InBufferLength, PCHAR pOutBuffer, PULONG pOutBufferLength)
Definition: utility.c:11
CHAR DefaultServer[256]
Definition: nslookup.h:85
PCHAR ClassIDtoClassName(USHORT ClassID)
Definition: utility.c:833
_In_ LONG _In_ LONG Limit
Definition: kefuncs.h:328
DWORD ixfrver
Definition: nslookup.h:81