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.

258 lines
4.9 KiB

  1. /*++
  2. Copyright (c) 1997 Microsoft Corporation
  3. Module Name:
  4. dnsrpcp.h
  5. Abstract:
  6. Domain Name System (DNS)
  7. DNS Record RPC defs
  8. Author:
  9. Glenn Curtis (glennc) January 11, 1997
  10. Jim Gilroy (jamesg) April 3, 1997
  11. Revision History:
  12. --*/
  13. #ifndef _DNSRPCP_INCLUDED_
  14. #define _DNSRPCP_INCLUDED_
  15. #include <dns.h>
  16. #ifdef __cplusplus
  17. extern "C"
  18. {
  19. #endif // _cplusplus
  20. #ifdef MIDL_PASS
  21. //
  22. // Record data for specific types
  23. //
  24. // These types don't require MIDL specific definitions and are taken
  25. // directly from dnsapi.h. The copying is ugly, but trying to get a
  26. // MIDL safe version of dnsapi.h, leaves it much uglier.
  27. //
  28. typedef struct
  29. {
  30. IP_ADDRESS ipAddress;
  31. }
  32. DNS_A_DATA, *PDNS_A_DATA;
  33. typedef struct
  34. {
  35. DNS_NAME nameHost;
  36. }
  37. DNS_PTR_DATA, *PDNS_PTR_DATA;
  38. typedef struct
  39. {
  40. DNS_NAME namePrimaryServer;
  41. DNS_NAME nameAdministrator;
  42. DWORD dwSerialNo;
  43. DWORD dwRefresh;
  44. DWORD dwRetry;
  45. DWORD dwExpire;
  46. DWORD dwDefaultTtl;
  47. }
  48. DNS_SOA_DATA, *PDNS_SOA_DATA;
  49. typedef struct
  50. {
  51. DNS_NAME nameMailbox;
  52. DNS_NAME nameErrorsMailbox;
  53. }
  54. DNS_MINFO_DATA, *PDNS_MINFO_DATA;
  55. typedef struct
  56. {
  57. DNS_NAME nameExchange;
  58. WORD wPreference;
  59. WORD Pad; // keep ptrs DWORD aligned
  60. }
  61. DNS_MX_DATA, *PDNS_MX_DATA;
  62. typedef struct
  63. {
  64. DWORD dwStringCount;
  65. DNS_TEXT pStringArray[1];
  66. }
  67. DNS_TXT_DATA, *PDNS_TXT_DATA;
  68. typedef struct
  69. {
  70. DWORD dwByteCount;
  71. BYTE bData[];
  72. }
  73. DNS_NULL_DATA, *PDNS_NULL_DATA;
  74. typedef struct
  75. {
  76. IP_ADDRESS ipAddress;
  77. UCHAR chProtocol;
  78. BYTE bBitMask[1];
  79. }
  80. DNS_WKS_DATA, *PDNS_WKS_DATA;
  81. typedef struct
  82. {
  83. IPV6_ADDRESS ipv6Address;
  84. }
  85. DNS_AAAA_DATA, *PDNS_AAAA_DATA;
  86. typedef struct
  87. {
  88. DNS_NAME nameTarget;
  89. WORD wPriority;
  90. WORD wWeight;
  91. WORD wPort;
  92. WORD Pad; // keep ptrs DWORD aligned
  93. }
  94. DNS_SRV_DATA, *PDNS_SRV_DATA;
  95. typedef struct
  96. {
  97. DWORD dwMappingFlag;
  98. DWORD dwLookupTimeout;
  99. DWORD dwCacheTimeout;
  100. DWORD cWinsServerCount;
  101. IP_ADDRESS aipWinsServers[];
  102. }
  103. DNS_WINS_DATA, *PDNS_WINS_DATA;
  104. typedef struct
  105. {
  106. DWORD dwMappingFlag;
  107. DWORD dwLookupTimeout;
  108. DWORD dwCacheTimeout;
  109. DNS_NAME nameResultDomain;
  110. }
  111. DNS_WINSR_DATA, *PDNS_WINSR_DATA;
  112. //
  113. // RPC record data types that requires explicit MIDL pass definition
  114. // different than non-MIDL definition in dnsapi.h
  115. //
  116. typedef struct
  117. {
  118. DWORD dwByteCount;
  119. [size_is(dwByteCount)] BYTE bData[];
  120. }
  121. DNS_NULL_DATA_RPC, *PDNS_NULL_DATA_RPC;
  122. typedef struct
  123. {
  124. DWORD dwStringCount;
  125. [size_is(dwStringCount*sizeof(PCHAR))] DNS_TEXT pStringArray[];
  126. }
  127. DNS_TXT_DATA_RPC, *PDNS_TXT_DATA_RPC;
  128. typedef struct
  129. {
  130. DWORD dwMappingFlag;
  131. DWORD dwLookupTimeout;
  132. DWORD dwCacheTimeout;
  133. DWORD cWinsServerCount;
  134. [size_is(cWinsServerCount*sizeof(IP_ADDRESS))] IP_ADDRESS aipWinsServers[];
  135. }
  136. DNS_WINS_DATA_RPC, *PDNS_WINS_DATA_RPC;
  137. //
  138. // Union of record types using RPC types as required
  139. //
  140. typedef [switch_type(WORD)] union _DNS_RECORD_DATA_UNION
  141. {
  142. [case(DNS_TYPE_A)] DNS_A_DATA A;
  143. [case(DNS_TYPE_SOA)] DNS_SOA_DATA SOA;
  144. [case(DNS_TYPE_PTR,
  145. DNS_TYPE_NS,
  146. DNS_TYPE_CNAME,
  147. DNS_TYPE_MB,
  148. DNS_TYPE_MD,
  149. DNS_TYPE_MF,
  150. DNS_TYPE_MG,
  151. DNS_TYPE_MR)] DNS_PTR_DATA PTR;
  152. [case(DNS_TYPE_MINFO,
  153. DNS_TYPE_RP)] DNS_MINFO_DATA MINFO;
  154. [case(DNS_TYPE_MX,
  155. DNS_TYPE_AFSDB,
  156. DNS_TYPE_RT)] DNS_MX_DATA MX;
  157. [case(DNS_TYPE_HINFO,
  158. DNS_TYPE_ISDN,
  159. DNS_TYPE_TEXT,
  160. DNS_TYPE_X25)] DNS_TXT_DATA_RPC TXT;
  161. [case(DNS_TYPE_NULL)] DNS_NULL_DATA_RPC Null;
  162. [case(DNS_TYPE_WKS)] DNS_WKS_DATA WKS;
  163. [case(DNS_TYPE_AAAA)] DNS_AAAA_DATA AAAA;
  164. [case(DNS_TYPE_SRV)] DNS_SRV_DATA SRV;
  165. [case(DNS_TYPE_WINS)] DNS_WINS_DATA_RPC WINS;
  166. [case(DNS_TYPE_NBSTAT)] DNS_WINSR_DATA WINSR;
  167. }
  168. DNS_RECORD_DATA_UNION;
  169. //
  170. // Record structure for RPC
  171. //
  172. typedef struct _DnsRecordRpc
  173. {
  174. struct _DnsRecordRpc * pNext;
  175. DNS_NAME nameOwner;
  176. DWORD Flags;
  177. DWORD dwTtl;
  178. WORD wDataLength;
  179. WORD wType;
  180. [switch_is(wType)] DNS_RECORD_DATA_UNION Data;
  181. }
  182. DNS_RECORD_RPC, * PDNS_RECORD_RPC;
  183. #else
  184. //
  185. // not MIDL_PASS
  186. //
  187. // for non-MIDL use, RPC record must identical field for field
  188. // with public defintion of DNS_RECORD
  189. //
  190. #include <dnsapi.h>
  191. typedef DNS_RECORD DNS_RECORD_RPC, *PDNS_RECORD_RPC;
  192. #endif // non-MIDL
  193. #ifdef __cplusplus
  194. }
  195. #endif // __cplusplus
  196. #endif // _DNSRPCP_INCLUDED_