Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

294 lines
5.9 KiB

  1. /*++
  2. Copyright(c) 1996-2000 Microsoft Corporation
  3. Module Name:
  4. record.h
  5. Abstract:
  6. Domain Name System (DNS) Library
  7. Resource record definitions.
  8. Author:
  9. Jim Gilroy (jamesg) December 1996
  10. Revision History:
  11. --*/
  12. #ifndef _DNS_RECORD_INCLUDED_
  13. #define _DNS_RECORD_INCLUDED_
  14. //
  15. // Temp header while changing definition of DNS_RECORD structure
  16. //
  17. #undef DNS_PTR_DATA
  18. #undef PDNS_PTR_DATA
  19. #undef DNS_SOA_DATA
  20. #undef PDNS_SOA_DATA
  21. #undef DNS_MINFO_DATA
  22. #undef PDNS_MINFO_DATA
  23. #undef DNS_MX_DATA
  24. #undef PDNS_MX_DATA
  25. #undef DNS_TXT_DATA
  26. #undef PDNS_TXT_DATA
  27. #undef DNS_SIG_DATA
  28. #undef PDNS_SIG_DATA
  29. #undef DNS_KEY_DATA
  30. #undef PDNS_KEY_DATA
  31. #undef DNS_NXT_DATA
  32. #undef PDNS_NXT_DATA
  33. #undef DNS_SRV_DATA
  34. #undef PDNS_SRV_DATA
  35. #undef DNS_TSIG_DATA
  36. #undef PDNS_TSIG_DATA
  37. #undef DNS_TKEY_DATA
  38. #undef PDNS_TKEY_DATA
  39. #undef DNS_WINSR_DATA
  40. #undef PDNS_WINSR_DATA
  41. // the big one
  42. #undef DNS_RECORD
  43. #undef PDNS_RECORD
  44. // the subs
  45. #undef DNS_TEXT
  46. #undef DNS_NAME
  47. //
  48. // Define PDNS_NAME and PDNS_TEXT to make explicit
  49. //
  50. #ifdef UNICODE
  51. typedef LPWSTR PDNS_NAME;
  52. #else
  53. typedef LPSTR PDNS_NAME;
  54. #endif
  55. #ifdef UNICODE
  56. typedef LPWSTR PDNS_TEXT;
  57. #else
  58. typedef LPSTR PDNS_TEXT;
  59. #endif
  60. //
  61. // Data types
  62. //
  63. typedef struct
  64. {
  65. PDNS_NAME pszHost;
  66. }
  67. DNS_PTR_DATA, *PDNS_PTR_DATA;
  68. typedef struct
  69. {
  70. PDNS_NAME pszPrimaryServer;
  71. PDNS_NAME pszAdministrator;
  72. DWORD dwSerialNo;
  73. DWORD dwRefresh;
  74. DWORD dwRetry;
  75. DWORD dwExpire;
  76. DWORD dwDefaultTtl;
  77. }
  78. DNS_SOA_DATA, *PDNS_SOA_DATA;
  79. typedef struct
  80. {
  81. PDNS_NAME pszMailbox;
  82. PDNS_NAME pszErrorsMailbox;
  83. }
  84. DNS_MINFO_DATA, *PDNS_MINFO_DATA;
  85. typedef struct
  86. {
  87. PDNS_NAME pszExchange;
  88. WORD wPreference;
  89. WORD Pad; // keep ptrs DWORD aligned
  90. }
  91. DNS_MX_DATA, *PDNS_MX_DATA;
  92. typedef struct
  93. {
  94. DWORD dwStringCount;
  95. PDNS_TEXT pStringArray[1];
  96. }
  97. DNS_TXT_DATA, *PDNS_TXT_DATA;
  98. typedef struct
  99. {
  100. PDNS_NAME pszSigner;
  101. WORD wTypeCovered;
  102. BYTE chAlgorithm;
  103. BYTE chLabelCount;
  104. DWORD dwOriginalTtl;
  105. DWORD dwSigExpiration;
  106. DWORD dwSigInception;
  107. WORD wKeyTag;
  108. WORD Pad; // keep byte field aligned
  109. BYTE Signature[1];
  110. }
  111. DNS_SIG_DATA, *PDNS_SIG_DATA;
  112. typedef struct
  113. {
  114. WORD wFlags;
  115. BYTE chProtocol;
  116. BYTE chAlgorithm;
  117. BYTE Key[1];
  118. }
  119. DNS_KEY_DATA, *PDNS_KEY_DATA;
  120. typedef struct
  121. {
  122. PDNS_NAME pszNext;
  123. BYTE bTypeBitMap[1];
  124. }
  125. DNS_NXT_DATA, *PDNS_NXT_DATA;
  126. typedef struct
  127. {
  128. PDNS_NAME pszTarget;
  129. WORD wPriority;
  130. WORD wWeight;
  131. WORD wPort;
  132. WORD Pad; // keep ptrs DWORD aligned
  133. }
  134. DNS_SRV_DATA, *PDNS_SRV_DATA;
  135. typedef struct
  136. {
  137. PDNS_NAME pszAlgorithm;
  138. PBYTE pAlgorithmPacket;
  139. PBYTE pKey;
  140. PBYTE pOtherData;
  141. DWORD dwCreateTime;
  142. DWORD dwExpireTime;
  143. WORD wMode;
  144. WORD wError;
  145. WORD wKeyLength;
  146. WORD wOtherLength;
  147. UCHAR cAlgNameLength;
  148. BOOLEAN fPacketPointers;
  149. }
  150. DNS_TKEY_DATA, *PDNS_TKEY_DATA;
  151. typedef struct
  152. {
  153. PDNS_NAME pszAlgorithm;
  154. PBYTE pAlgorithmPacket;
  155. PBYTE pSignature;
  156. PBYTE pOtherData;
  157. LONGLONG i64CreateTime;
  158. WORD wFudgeTime;
  159. WORD wError;
  160. WORD wSigLength;
  161. WORD wOtherLength;
  162. UCHAR cAlgNameLength;
  163. BOOLEAN fPacketPointers;
  164. }
  165. DNS_TSIG_DATA, *PDNS_TSIG_DATA;
  166. //
  167. // MS only types -- only hit the wire in MS-MS zone transfer
  168. //
  169. typedef struct
  170. {
  171. DWORD dwMappingFlag;
  172. DWORD dwLookupTimeout;
  173. DWORD dwCacheTimeout;
  174. PDNS_NAME pszResultDomain;
  175. }
  176. DNS_WINSR_DATA, *PDNS_WINSR_DATA;
  177. //
  178. // Record \ RR set structure
  179. //
  180. // Note: The dwReserved flag serves to insure that the substructures
  181. // start on 64-bit boundaries. Since adding the LONGLONG to
  182. // TSIG structure the compiler wants to start them there anyway
  183. // (to 64-align). This insures that no matter what data fields
  184. // are present we are properly 64-aligned.
  185. //
  186. // Do NOT pack this structure, as the substructures to be 64-aligned
  187. // for Win64.
  188. //
  189. typedef struct _DnsRecord
  190. {
  191. struct _DnsRecord * pNext;
  192. PDNS_NAME pszOwner;
  193. WORD wType;
  194. WORD wDataLength;
  195. union
  196. {
  197. DWORD W; // flags as dword
  198. DNSREC_FLAGS S; // flags as structure
  199. } Flags;
  200. DWORD dwTtl;
  201. DWORD dwReserved;
  202. union
  203. {
  204. DNS_A_DATA A;
  205. DNS_SOA_DATA SOA, Soa;
  206. DNS_PTR_DATA PTR, Ptr,
  207. NS, Ns,
  208. CNAME, Cname,
  209. MB, Mb,
  210. MD, Md,
  211. MF, Mf,
  212. MG, Mg,
  213. MR, Mr;
  214. DNS_MINFO_DATA MINFO, Minfo,
  215. RP, Rp;
  216. DNS_MX_DATA MX, Mx,
  217. AFSDB, Afsdb,
  218. RT, Rt;
  219. DNS_TXT_DATA HINFO, Hinfo,
  220. ISDN, Isdn,
  221. TXT, Txt,
  222. X25;
  223. DNS_NULL_DATA Null;
  224. DNS_WKS_DATA WKS, Wks;
  225. DNS_AAAA_DATA AAAA;
  226. DNS_SRV_DATA SRV, Srv;
  227. DNS_TKEY_DATA TKEY, Tkey;
  228. DNS_TSIG_DATA TSIG, Tsig;
  229. DNS_ATMA_DATA ATMA, Atma;
  230. DNS_WINS_DATA WINS, Wins;
  231. DNS_WINSR_DATA WINSR, WinsR, NBSTAT, Nbstat;
  232. } Data;
  233. }
  234. DNS_RECORD, *PDNS_RECORD;
  235. #endif // _DNS_RECORD_INCLUDED_