Create a branch for header work.
[reactos.git] / base / applications / network / nslookup / nslookup.h
1 #define TypeA "A"
2 #define TypeAAAA "AAAA"
3 #define TypeBoth "A+AAAA"
4 #define TypeAny "ANY"
5 #define TypeCNAME "CNAME"
6 #define TypeMX "MX"
7 #define TypeNS "NS"
8 #define TypePTR "PTR"
9 #define TypeSOA "SOA"
10 #define TypeSRV "SRV"
11
12 #define TYPE_A 0x01
13 #define TYPE_NS 0x02
14 #define TYPE_CNAME 0x05
15 #define TYPE_SOA 0x06
16 #define TYPE_WKS 0x0B
17 #define TYPE_PTR 0x0C
18 #define TYPE_MX 0x0F
19 #define TYPE_ANY 0xFF
20
21 #define ClassIN "IN"
22 #define ClassAny "ANY"
23
24 #define CLASS_IN 0x01
25 #define CLASS_ANY 0xFF
26
27 #define OPCODE_QUERY 0x00
28 #define OPCODE_IQUERY 0x01
29 #define OPCODE_STATUS 0x02
30
31 #define OpcodeQuery "QUERY"
32 #define OpcodeIQuery "IQUERY"
33 #define OpcodeStatus "STATUS"
34 #define OpcodeReserved "RESERVED"
35
36 #define RCODE_NOERROR 0x00
37 #define RCODE_FORMERR 0x01
38 #define RCODE_FAILURE 0x02
39 #define RCODE_NXDOMAIN 0x03
40 #define RCODE_NOTIMP 0x04
41 #define RCODE_REFUSED 0x05
42
43 #define RCodeNOERROR "NOERROR"
44 #define RCodeFORMERR "FORMERR"
45 #define RCodeFAILURE "FAILURE"
46 #define RCodeNXDOMAIN "NXDOMAIN"
47 #define RCodeNOTIMP "NOTIMP"
48 #define RCodeREFUSED "REFUSED"
49 #define RCodeReserved "RESERVED"
50
51 #define DEFAULT_ROOT "A.ROOT-SERVERS.NET."
52 #define ARPA_SIG ".in-addr.arpa"
53
54 typedef struct _STATE
55 {
56 BOOL debug;
57 BOOL defname;
58 BOOL d2;
59 BOOL recurse;
60 BOOL search;
61 BOOL vc;
62 BOOL ignoretc;
63 BOOL MSxfr;
64 CHAR domain[256];
65 CHAR srchlist[6][256];
66 CHAR root[256];
67 DWORD retry;
68 DWORD timeout;
69 DWORD ixfrver;
70 PCHAR type;
71 PCHAR Class;
72 USHORT port;
73 CHAR DefaultServer[256];
74 CHAR DefaultServerAddress[16];
75 } STATE, *PSTATE;
76
77 /* nslookup.c */
78
79 extern STATE State;
80 extern HANDLE ProcessHeap;
81
82 /* utility.c */
83
84 BOOL SendRequest( PCHAR pInBuffer,
85 ULONG InBufferLength,
86 PCHAR pOutBuffer,
87 PULONG pOutBufferLength );
88
89 int ExtractName( PCHAR pBuffer,
90 PCHAR pOutput,
91 USHORT Offset,
92 UCHAR Limit );
93
94 void ReverseIP( PCHAR pIP, PCHAR pReturn );
95 BOOL IsValidIP( PCHAR pInput );
96 int ExtractIP( PCHAR pBuffer, PCHAR pOutput, USHORT Offset );
97 void PrintD2( PCHAR pBuffer, DWORD BufferLength );
98 void PrintDebug( PCHAR pBuffer, DWORD BufferLength );
99 PCHAR OpcodeIDtoOpcodeName( UCHAR Opcode );
100 PCHAR RCodeIDtoRCodeName( UCHAR RCode );
101 PCHAR TypeIDtoTypeName( USHORT TypeID );
102 USHORT TypeNametoTypeID( PCHAR TypeName );
103 PCHAR ClassIDtoClassName( USHORT ClassID );
104 USHORT ClassNametoClassID( PCHAR ClassName );