Source code of Windows XP (NT5)
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.

4393 lines
113 KiB

  1. /*++
  2. Copyright (c) 1995-2000 Microsoft Corporation
  3. Module Name:
  4. dnsrpc.h
  5. Abstract:
  6. Domain Name System (DNS) Server
  7. DNS Server RPC API to support admin clients.
  8. Author:
  9. Jim Gilroy (jamesg) September 1997
  10. Revision History:
  11. jamesg April 1997 -- Major revision for NT5
  12. --*/
  13. #ifndef _DNSRPC_INCLUDED_
  14. #define _DNSRPC_INCLUDED_
  15. #include <windns.h>
  16. //
  17. // Do NOT include dnsapi.h if doing MIDL pass
  18. //
  19. #ifndef MIDL_PASS
  20. #include <dnsapi.h>
  21. #include <dnslib.h>
  22. #endif
  23. #ifdef __cplusplus
  24. extern "C"
  25. {
  26. #endif // _cplusplus
  27. //
  28. // Versioning scheme
  29. // -----------------
  30. //
  31. // Every RPC structure has an old (W2K, non-version-numbered) version and
  32. // at least one new (Whistler and post Whistler) version. We will be adding
  33. // completely new copies of each structure as needed with every release.
  34. // The structure version numbers start at 1 and are independent of between
  35. // structures. Increment each structure's current version number as
  36. // required. Structure version do not have to change at product release
  37. // so we will not tie their versions to release versions.
  38. //
  39. // New to Whistler, the client RPC APIs all take a version number. This is
  40. // the client version in terms of OS with a minor version number to identify
  41. // service packs or QFEs where necessary.
  42. //
  43. //
  44. // For each versioned RPC structure, define the structure's current version
  45. // and point the generic names of the structure at the current typedefs.
  46. //
  47. #define DNS_RPC_SERVER_INFO_VER 1
  48. #define DNS_RPC_SERVER_INFO DNS_RPC_SERVER_INFO_WHISTLER
  49. #define PDNS_RPC_SERVER_INFO PDNS_RPC_SERVER_INFO_WHISTLER
  50. #define DNS_RPC_ZONE_VER 1
  51. #define DNS_RPC_ZONE DNS_RPC_ZONE_WHISTLER
  52. #define PDNS_RPC_ZONE PDNS_RPC_ZONE_WHISTLER
  53. #define DNS_RPC_ZONE_LIST_VER 1
  54. #define DNS_RPC_ZONE_LIST DNS_RPC_ZONE_LIST_WHISTLER
  55. #define PDNS_RPC_ZONE_LIST PDNS_RPC_ZONE_LIST_WHISTLER
  56. #define DNS_RPC_ZONE_INFO_VER 1
  57. #define DNS_RPC_ZONE_INFO DNS_RPC_ZONE_INFO_WHISTLER
  58. #define PDNS_RPC_ZONE_INFO PDNS_RPC_ZONE_INFO_WHISTLER
  59. #define DNS_RPC_ZONE_CREATE_INFO_VER 1
  60. #define DNS_RPC_ZONE_CREATE_INFO DNS_RPC_ZONE_CREATE_INFO_WHISTLER
  61. #define PDNS_RPC_ZONE_CREATE_INFO PDNS_RPC_ZONE_CREATE_INFO_WHISTLER
  62. #define DNS_RPC_FORWARDERS_VER 1
  63. #define DNS_RPC_FORWARDERS DNS_RPC_FORWARDERS_WHISTLER
  64. #define PDNS_RPC_FORWARDERS PDNS_RPC_FORWARDERS_WHISTLER
  65. #define DNS_RPC_ZONE_SECONDARIES_VER 1
  66. #define DNS_RPC_ZONE_SECONDARIES DNS_RPC_ZONE_SECONDARIES_WHISTLER
  67. #define PDNS_RPC_ZONE_SECONDARIES PDNS_RPC_ZONE_SECONDARIES_WHISTLER
  68. #define DNS_RPC_ZONE_DATABASE_VER 1
  69. #define DNS_RPC_ZONE_DATABASE DNS_RPC_ZONE_DATABASE_WHISTLER
  70. #define PDNS_RPC_ZONE_DATABASE PDNS_RPC_ZONE_DATABASE_WHISTLER
  71. #define DNS_RPC_ZONE_TYPE_RESET_VER 1
  72. #define DNS_RPC_ZONE_TYPE_RESET DNS_RPC_ZONE_TYPE_RESET_WHISTLER
  73. #define PDNS_RPC_ZONE_TYPE_RESET PDNS_RPC_ZONE_TYPE_RESET_WHISTLER
  74. #define DNS_RPC_ZONE_RENAME_INFO_VER 1
  75. #define DNS_RPC_ZONE_EXPORT_INFO_VER 1
  76. #define DNS_RPC_ENLIST_DP_VER 1
  77. #define DNS_RPC_ZONE_CHANGE_DP_VER 1
  78. #ifdef MIDL_PASS
  79. #ifndef _DNSAPI_INCLUDED_
  80. //
  81. // NOTE: DO NOT USE these IP definitions.
  82. //
  83. // They are for backward compatibility only.
  84. // Use the definitions in windns.h instead.
  85. //
  86. // Note, this same include is in dnsapi.h, so ONLY
  87. // include on MIDL_PASS which skips dnsapi.h
  88. //
  89. //
  90. // IP Address
  91. //
  92. typedef IP4_ADDRESS IP_ADDRESS, *PIP_ADDRESS;
  93. //
  94. // IP Address Array type
  95. //
  96. typedef struct _IP_ARRAY
  97. {
  98. DWORD AddrCount;
  99. [size_is( AddrCount )] IP4_ADDRESS AddrArray[];
  100. }
  101. IP_ARRAY, *PIP_ARRAY;
  102. //
  103. // IPv6 Address
  104. //
  105. typedef IP6_ADDRESS IPV6_ADDRESS, *PIPV6_ADDRESS;
  106. #endif // _DNSAPI_INCLUDED_
  107. #endif // MIDL_PASS
  108. //
  109. // Use stdcall for our API conventions
  110. //
  111. // Explicitly state this as C++ compiler will otherwise
  112. // assume cdecl.
  113. //
  114. #define DNS_API_FUNCTION __stdcall
  115. //
  116. // RPC interface
  117. //
  118. #define DNS_INTERFACE_NAME "DNSSERVER"
  119. //
  120. // RPC interface version
  121. //
  122. #define DNS_RPC_VERSION (50) // NT5
  123. //
  124. // RPC security
  125. //
  126. #define DNS_RPC_SECURITY "DnsServerApp"
  127. #define DNS_RPC_SECURITY_AUTH_ID RPC_C_AUTHN_WINNT
  128. //
  129. // RPC transports
  130. //
  131. #define DNS_RPC_NAMED_PIPE_W ( L"\\PIPE\\DNSSERVER" )
  132. #define DNS_RPC_SERVER_PORT_W ( L"" )
  133. #define DNS_RPC_LPC_EP_W ( L"DNSSERVERLPC" )
  134. #define DNS_RPC_NAMED_PIPE_A ( "\\PIPE\\DNSSERVER" )
  135. #define DNS_RPC_SERVER_PORT_A ( "" )
  136. #define DNS_RPC_LPC_EP_A ( "DNSSERVERLPC" )
  137. #define DNS_RPC_USE_TCPIP 0x1
  138. #define DNS_RPC_USE_NAMED_PIPE 0x2
  139. #define DNS_RPC_USE_LPC 0x4
  140. #define DNS_RPC_USE_ALL_PROTOCOLS 0xffffffff
  141. //
  142. // Windows types we define only for MIDL_PASS
  143. //
  144. #ifdef MIDL_PASS
  145. #define LPSTR [string] char *
  146. #define LPCSTR [string] const char *
  147. #define LPWSTR [string] wchar_t *
  148. #endif
  149. //
  150. // RPC buffer type for returned data
  151. //
  152. typedef struct _DnssrvRpcBuffer
  153. {
  154. DWORD dwLength;
  155. #ifdef MIDL_PASS
  156. [size_is(dwLength)] BYTE Buffer[];
  157. #else
  158. BYTE Buffer[1]; // buffer of dwLength
  159. #endif
  160. }
  161. DNS_RPC_BUFFER, *PDNS_RPC_BUFFER;
  162. //
  163. // Server data types
  164. //
  165. //
  166. // Server Information
  167. //
  168. typedef struct _DnsRpcServerInfoW2K
  169. {
  170. // version
  171. // basic configuration flags
  172. DWORD dwVersion;
  173. UCHAR fBootMethod;
  174. BOOLEAN fAdminConfigured;
  175. BOOLEAN fAllowUpdate;
  176. BOOLEAN fDsAvailable;
  177. //
  178. // pointer section
  179. //
  180. LPSTR pszServerName;
  181. // DS container
  182. LPWSTR pszDsContainer;
  183. // IP interfaces
  184. PIP_ARRAY aipServerAddrs;
  185. PIP_ARRAY aipListenAddrs;
  186. // forwarders
  187. PIP_ARRAY aipForwarders;
  188. // future extensions
  189. PDWORD pExtension1;
  190. PDWORD pExtension2;
  191. PDWORD pExtension3;
  192. PDWORD pExtension4;
  193. PDWORD pExtension5;
  194. //
  195. // DWORD section
  196. //
  197. // logging
  198. DWORD dwLogLevel;
  199. DWORD dwDebugLevel;
  200. // configuration DWORDs
  201. DWORD dwForwardTimeout;
  202. DWORD dwRpcProtocol;
  203. DWORD dwNameCheckFlag;
  204. DWORD cAddressAnswerLimit;
  205. DWORD dwRecursionRetry;
  206. DWORD dwRecursionTimeout;
  207. DWORD dwMaxCacheTtl;
  208. DWORD dwDsPollingInterval;
  209. // aging \ scavenging
  210. DWORD dwScavengingInterval;
  211. DWORD dwDefaultRefreshInterval;
  212. DWORD dwDefaultNoRefreshInterval;
  213. DWORD dwReserveArray[10];
  214. //
  215. // BYTE section
  216. //
  217. // configuration flags
  218. BOOLEAN fAutoReverseZones;
  219. BOOLEAN fAutoCacheUpdate;
  220. // recursion control
  221. BOOLEAN fSlave;
  222. BOOLEAN fForwardDelegations;
  223. BOOLEAN fNoRecursion;
  224. BOOLEAN fSecureResponses;
  225. // lookup control
  226. BOOLEAN fRoundRobin;
  227. BOOLEAN fLocalNetPriority;
  228. // BIND compatibility and mimicing
  229. BOOLEAN fBindSecondaries;
  230. BOOLEAN fWriteAuthorityNs;
  231. // Bells and whistles
  232. BOOLEAN fStrictFileParsing;
  233. BOOLEAN fLooseWildcarding;
  234. // aging \ scavenging
  235. BOOLEAN fDefaultAgingState;
  236. BOOLEAN fReserveArray[15];
  237. }
  238. DNS_RPC_SERVER_INFO_W2K, *PDNS_RPC_SERVER_INFO_W2K;
  239. typedef struct _DnsRpcServerInfoWhistler
  240. {
  241. DWORD dwRpcStuctureVersion;
  242. DWORD dwReserved0;
  243. // basic configuration flags
  244. DWORD dwVersion;
  245. UCHAR fBootMethod;
  246. BOOLEAN fAdminConfigured;
  247. BOOLEAN fAllowUpdate;
  248. BOOLEAN fDsAvailable;
  249. //
  250. // pointer section
  251. //
  252. LPSTR pszServerName;
  253. // DS container
  254. LPWSTR pszDsContainer;
  255. // IP interfaces
  256. PIP_ARRAY aipServerAddrs;
  257. PIP_ARRAY aipListenAddrs;
  258. // forwarders
  259. PIP_ARRAY aipForwarders;
  260. // logging
  261. PIP_ARRAY aipLogFilter;
  262. LPWSTR pwszLogFilePath;
  263. // Server domain/forest
  264. LPSTR pszDomainName; // UTF-8 FQDN
  265. LPSTR pszForestName; // UTF-8 FQDN
  266. // Built-in directory partitions
  267. LPSTR pszDomainDirectoryPartition; // UTF-8 FQDN
  268. LPSTR pszForestDirectoryPartition; // UTF-8 FQDN
  269. // future extensions
  270. LPSTR pExtensions[ 6 ];
  271. //
  272. // DWORD section
  273. //
  274. // logging
  275. DWORD dwLogLevel;
  276. DWORD dwDebugLevel;
  277. // configuration DWORDs
  278. DWORD dwForwardTimeout;
  279. DWORD dwRpcProtocol;
  280. DWORD dwNameCheckFlag;
  281. DWORD cAddressAnswerLimit;
  282. DWORD dwRecursionRetry;
  283. DWORD dwRecursionTimeout;
  284. DWORD dwMaxCacheTtl;
  285. DWORD dwDsPollingInterval;
  286. DWORD dwLocalNetPriorityNetMask;
  287. // aging and scavenging
  288. DWORD dwScavengingInterval;
  289. DWORD dwDefaultRefreshInterval;
  290. DWORD dwDefaultNoRefreshInterval;
  291. DWORD dwLastScavengeTime;
  292. // more logging
  293. DWORD dwEventLogLevel;
  294. DWORD dwLogFileMaxSize;
  295. // Active Directory information
  296. DWORD dwAdForestVersion;
  297. DWORD dwAdDomainVersion;
  298. DWORD dwAdDsaVersion;
  299. DWORD dwReserveArray[ 4 ];
  300. //
  301. // BYTE section
  302. //
  303. // configuration flags
  304. BOOLEAN fAutoReverseZones;
  305. BOOLEAN fAutoCacheUpdate;
  306. // recursion control
  307. BOOLEAN fSlave;
  308. BOOLEAN fForwardDelegations;
  309. BOOLEAN fNoRecursion;
  310. BOOLEAN fSecureResponses;
  311. // lookup control
  312. BOOLEAN fRoundRobin;
  313. BOOLEAN fLocalNetPriority;
  314. // BIND compatibility and mimicing
  315. BOOLEAN fBindSecondaries;
  316. BOOLEAN fWriteAuthorityNs;
  317. // Bells and whistles
  318. BOOLEAN fStrictFileParsing;
  319. BOOLEAN fLooseWildcarding;
  320. // aging \ scavenging
  321. BOOLEAN fDefaultAgingState;
  322. BOOLEAN fReserveArray[ 15 ];
  323. }
  324. DNS_RPC_SERVER_INFO_WHISTLER, *PDNS_RPC_SERVER_INFO_WHISTLER;
  325. typedef IP_ARRAY DNS_RPC_LISTEN_ADDRESSES, *PDNS_RPC_LISTEN_ADDRESSES;
  326. typedef struct _DnssrvRpcForwardersW2K
  327. {
  328. DWORD fSlave;
  329. DWORD dwForwardTimeout;
  330. PIP_ARRAY aipForwarders;
  331. }
  332. DNS_RPC_FORWARDERS_W2K, *PDNS_RPC_FORWARDERS_W2K;
  333. typedef struct _DnssrvRpcForwardersWhistler
  334. {
  335. DWORD dwRpcStuctureVersion;
  336. DWORD dwReserved0;
  337. DWORD fSlave;
  338. DWORD dwForwardTimeout;
  339. PIP_ARRAY aipForwarders;
  340. }
  341. DNS_RPC_FORWARDERS_WHISTLER, *PDNS_RPC_FORWARDERS_WHISTLER;
  342. //
  343. // Server API
  344. //
  345. DNS_STATUS
  346. DNS_API_FUNCTION
  347. DnssrvGetServerInfo(
  348. IN LPCWSTR pwszServer,
  349. OUT PDNS_RPC_SERVER_INFO * ppServerInfo
  350. );
  351. VOID
  352. DNS_API_FUNCTION
  353. DnssrvFreeServerInfo(
  354. IN OUT PDNS_RPC_SERVER_INFO pServerInfo
  355. );
  356. DNS_STATUS
  357. DNS_API_FUNCTION
  358. DnssrvResetServerDwordProperty(
  359. IN LPCWSTR pwszServer,
  360. IN LPCSTR pszProperty,
  361. IN DWORD dwPropertyValue
  362. );
  363. DNS_STATUS
  364. DNS_API_FUNCTION
  365. DnssrvResetServerListenAddresses(
  366. IN LPCWSTR pwszServer,
  367. IN DWORD cListenAddrs,
  368. IN PIP_ADDRESS aipListenAddrs
  369. );
  370. DNS_STATUS
  371. DNS_API_FUNCTION
  372. DnssrvResetForwarders(
  373. IN LPCWSTR pwszServer,
  374. IN DWORD cForwarders,
  375. IN PIP_ADDRESS aipForwarders,
  376. IN DWORD dwForwardTimeout,
  377. IN DWORD fSlave
  378. );
  379. DNS_STATUS
  380. DNS_API_FUNCTION
  381. DnssrvWriteDirtyZones(
  382. IN LPCWSTR pwszServer
  383. );
  384. VOID
  385. DNS_API_FUNCTION
  386. DnssrvFreeRpcBuffer(
  387. IN OUT PDNS_RPC_BUFFER pBuf
  388. );
  389. //
  390. // Create DS\LDAP paths to objects
  391. //
  392. LPWSTR
  393. DNS_API_FUNCTION
  394. DnssrvCreateDsNodeName(
  395. IN PDNS_RPC_SERVER_INFO pServerInfo,
  396. IN LPWSTR pszZone,
  397. IN LPWSTR pszNode
  398. );
  399. LPWSTR
  400. DNS_API_FUNCTION
  401. DnssrvCreateDsZoneName(
  402. IN PDNS_RPC_SERVER_INFO pServerInfo,
  403. IN LPWSTR pszZone
  404. );
  405. LPWSTR
  406. DNS_API_FUNCTION
  407. DnssrvCreateDsServerName(
  408. IN PDNS_RPC_SERVER_INFO pServerInfo
  409. );
  410. //
  411. // DNS server statistics
  412. //
  413. typedef struct _DnsSystemTime
  414. {
  415. WORD wYear;
  416. WORD wMonth;
  417. WORD wDayOfWeek;
  418. WORD wDay;
  419. WORD wHour;
  420. WORD wMinute;
  421. WORD wSecond;
  422. WORD wMilliseconds;
  423. }
  424. DNS_SYSTEMTIME;
  425. //
  426. // Server run time stats
  427. // Each stat has header followed by stat data.
  428. //
  429. // Stat header
  430. typedef struct _DnsStatHeader
  431. {
  432. DWORD StatId;
  433. WORD wLength;
  434. BOOLEAN fClear;
  435. UCHAR fReserved;
  436. }
  437. DNSSRV_STAT_HEADER, *PDNSSRV_STAT_HEADER;
  438. // Generic stat buffer
  439. typedef struct _DnsStat
  440. {
  441. DNSSRV_STAT_HEADER Header;
  442. BYTE Buffer[1];
  443. }
  444. DNSSRV_STAT, *PDNSSRV_STAT;
  445. // DCR_CLEANUP: remove when marco in ssync
  446. typedef DNSSRV_STAT DNSSRV_STATS;
  447. typedef PDNSSRV_STAT PDNSSRV_STATS;
  448. #define DNSSRV_STATS_HEADER_LENGTH (2*sizeof(DWORD))
  449. // Total length of stats buffer
  450. #define TOTAL_STAT_LENGTH( pStat ) \
  451. ( (pStat)->Header.wLength + sizeof(DNSSRV_STAT_HEADER) )
  452. // Stat buffer traversal macro, no side effects in argument
  453. #define GET_NEXT_STAT_IN_BUFFER( pStat ) \
  454. ((PDNSSRV_STAT)( (PCHAR)(pStat) + TOTAL_STAT_LENGTH(pStat) ))
  455. //
  456. // Stats that record type data
  457. // - ATMA plus room to grow, so don't have to
  458. // rebuild for any change
  459. // - use some dead types for mixed and unknown
  460. // cases
  461. //
  462. #define STATS_TYPE_MAX (DNS_TYPE_ATMA+5)
  463. #define STATS_TYPE_MIXED (DNS_TYPE_MD)
  464. #define STATS_TYPE_UNKNOWN (DNS_TYPE_MF)
  465. //
  466. // Specific stat data types
  467. //
  468. //
  469. // Time info
  470. //
  471. typedef struct _DnsTimeStats
  472. {
  473. DNSSRV_STAT_HEADER Header;
  474. DWORD ServerStartTimeSeconds;
  475. DWORD LastClearTimeSeconds;
  476. DWORD SecondsSinceServerStart;
  477. DWORD SecondsSinceLastClear;
  478. DNS_SYSTEMTIME ServerStartTime;
  479. DNS_SYSTEMTIME LastClearTime;
  480. }
  481. DNSSRV_TIME_STATS, *PDNSSRV_TIME_STATS;
  482. //
  483. // Basic query and response stats
  484. //
  485. typedef struct _DnsQueryStats
  486. {
  487. DNSSRV_STAT_HEADER Header;
  488. DWORD UdpQueries;
  489. DWORD UdpResponses;
  490. DWORD UdpQueriesSent;
  491. DWORD UdpResponsesReceived;
  492. DWORD TcpClientConnections;
  493. DWORD TcpQueries;
  494. DWORD TcpResponses;
  495. DWORD TcpQueriesSent;
  496. DWORD TcpResponsesReceived;
  497. }
  498. DNSSRV_QUERY_STATS, *PDNSSRV_QUERY_STATS;
  499. typedef struct _DnsQuery2Stats
  500. {
  501. DNSSRV_STAT_HEADER Header;
  502. DWORD TotalQueries;
  503. DWORD Standard;
  504. DWORD Notify;
  505. DWORD Update;
  506. DWORD TKeyNego;
  507. // NOTE: the breakout counts are for STANDARD QUERIES!
  508. DWORD TypeA;
  509. DWORD TypeNs;
  510. DWORD TypeSoa;
  511. DWORD TypeMx;
  512. DWORD TypePtr;
  513. DWORD TypeSrv;
  514. DWORD TypeAll;
  515. DWORD TypeIxfr;
  516. DWORD TypeAxfr;
  517. DWORD TypeOther;
  518. }
  519. DNSSRV_QUERY2_STATS, *PDNSSRV_QUERY2_STATS;
  520. //
  521. // Recursion stats
  522. //
  523. typedef struct _DnsRecurseStats
  524. {
  525. DNSSRV_STAT_HEADER Header;
  526. DWORD ReferralPasses;
  527. DWORD QueriesRecursed;
  528. DWORD OriginalQuestionRecursed;
  529. DWORD AdditionalRecursed;
  530. DWORD TotalQuestionsRecursed;
  531. DWORD Retries;
  532. DWORD LookupPasses;
  533. DWORD Forwards;
  534. DWORD Sends;
  535. DWORD Responses;
  536. DWORD ResponseUnmatched;
  537. DWORD ResponseMismatched;
  538. DWORD ResponseFromForwarder;
  539. DWORD ResponseAuthoritative;
  540. DWORD ResponseNotAuth;
  541. DWORD ResponseAnswer;
  542. DWORD ResponseNameError;
  543. DWORD ResponseRcode;
  544. DWORD ResponseEmpty;
  545. DWORD ResponseDelegation;
  546. DWORD ResponseNonZoneData;
  547. DWORD ResponseUnsecure;
  548. DWORD ResponseBadPacket;
  549. DWORD SendResponseDirect;
  550. DWORD ContinueCurrentRecursion;
  551. DWORD ContinueCurrentLookup;
  552. DWORD ContinueNextLookup;
  553. DWORD RootNsQuery;
  554. DWORD RootNsResponse;
  555. DWORD CacheUpdateAlloc;
  556. DWORD CacheUpdateResponse;
  557. DWORD CacheUpdateFree;
  558. DWORD CacheUpdateRetry;
  559. DWORD SuspendedQuery;
  560. DWORD ResumeSuspendedQuery;
  561. DWORD PacketTimeout;
  562. DWORD FinalTimeoutQueued;
  563. DWORD FinalTimeoutExpired;
  564. DWORD Failures;
  565. DWORD RecursionFailure;
  566. DWORD ServerFailure;
  567. DWORD PartialFailure;
  568. DWORD CacheUpdateFailure;
  569. DWORD RecursePassFailure;
  570. DWORD FailureReachAuthority;
  571. DWORD FailureReachPreviousResponse;
  572. DWORD FailureRetryCount;
  573. DWORD TcpTry;
  574. DWORD TcpConnectFailure;
  575. DWORD TcpConnect;
  576. DWORD TcpQuery;
  577. DWORD TcpResponse;
  578. DWORD TcpDisconnect;
  579. DWORD DiscardedDuplicateQueries;
  580. }
  581. DNSSRV_RECURSE_STATS, *PDNSSRV_RECURSE_STATS;
  582. //
  583. // Master stats
  584. //
  585. // Masters stats changed post-NT5 for stub zones
  586. //
  587. typedef struct _DnsMasterStats
  588. {
  589. DNSSRV_STAT_HEADER Header;
  590. DWORD NotifySent;
  591. DWORD Request;
  592. DWORD NameError;
  593. DWORD FormError;
  594. DWORD AxfrLimit;
  595. DWORD Refused;
  596. DWORD RefuseSecurity;
  597. DWORD RefuseShutdown;
  598. DWORD RefuseZoneLocked;
  599. DWORD RefuseServerFailure;
  600. DWORD Failure;
  601. DWORD AxfrRequest;
  602. DWORD AxfrSuccess;
  603. DWORD StubAxfrRequest;
  604. DWORD IxfrRequest;
  605. DWORD IxfrNoVersion;
  606. DWORD IxfrUpdateSuccess;
  607. DWORD IxfrTcpRequest;
  608. DWORD IxfrTcpSuccess;
  609. DWORD IxfrAxfr;
  610. DWORD IxfrUdpRequest;
  611. DWORD IxfrUdpSuccess;
  612. DWORD IxfrUdpForceTcp;
  613. DWORD IxfrUdpForceAxfr;
  614. }
  615. DNSSRV_MASTER_STATS, *PDNSSRV_MASTER_STATS;
  616. //
  617. // Secondary stats
  618. //
  619. // Secondary stats changed post-NT5 for stub zones
  620. //
  621. typedef struct _DnsSecondaryStats
  622. {
  623. DNSSRV_STAT_HEADER Header;
  624. DWORD NotifyReceived;
  625. DWORD NotifyInvalid;
  626. DWORD NotifyPrimary;
  627. DWORD NotifyNonPrimary;
  628. DWORD NotifyNoVersion;
  629. DWORD NotifyNewVersion;
  630. DWORD NotifyCurrentVersion;
  631. DWORD NotifyOldVersion;
  632. DWORD NotifyMasterUnknown;
  633. DWORD SoaRequest;
  634. DWORD SoaResponse;
  635. DWORD SoaResponseInvalid;
  636. DWORD SoaResponseNameError;
  637. DWORD AxfrRequest;
  638. DWORD AxfrResponse;
  639. DWORD AxfrSuccess;
  640. DWORD AxfrRefused;
  641. DWORD AxfrInvalid;
  642. DWORD StubAxfrRequest;
  643. DWORD StubAxfrResponse;
  644. DWORD StubAxfrSuccess;
  645. DWORD StubAxfrRefused;
  646. DWORD StubAxfrInvalid;
  647. DWORD IxfrUdpRequest;
  648. DWORD IxfrUdpResponse;
  649. DWORD IxfrUdpSuccess;
  650. DWORD IxfrUdpUseTcp;
  651. DWORD IxfrUdpUseAxfr;
  652. DWORD IxfrUdpWrongServer;
  653. DWORD IxfrUdpNoUpdate;
  654. DWORD IxfrUdpNewPrimary;
  655. DWORD IxfrUdpFormerr;
  656. DWORD IxfrUdpRefused;
  657. DWORD IxfrUdpInvalid;
  658. DWORD IxfrTcpRequest;
  659. DWORD IxfrTcpResponse;
  660. DWORD IxfrTcpSuccess;
  661. DWORD IxfrTcpAxfr;
  662. DWORD IxfrTcpFormerr;
  663. DWORD IxfrTcpRefused;
  664. DWORD IxfrTcpInvalid;
  665. }
  666. DNSSRV_SECONDARY_STATS, *PDNSSRV_SECONDARY_STATS;
  667. //
  668. // WINS lookup
  669. //
  670. typedef struct _DnsWinsStats
  671. {
  672. DNSSRV_STAT_HEADER Header;
  673. DWORD WinsLookups;
  674. DWORD WinsResponses;
  675. DWORD WinsReverseLookups;
  676. DWORD WinsReverseResponses;
  677. }
  678. DNSSRV_WINS_STATS, *PDNSSRV_WINS_STATS;
  679. //
  680. // Dynamic Update Stats
  681. //
  682. typedef struct _DnsUpdateStats
  683. {
  684. DNSSRV_STAT_HEADER Header;
  685. DWORD Received;
  686. DWORD Empty;
  687. DWORD NoOps;
  688. DWORD Completed;
  689. DWORD Rejected;
  690. DWORD FormErr;
  691. DWORD NxDomain;
  692. DWORD NotImpl;
  693. DWORD Refused;
  694. DWORD YxDomain;
  695. DWORD YxRrset;
  696. DWORD NxRrset;
  697. DWORD NotAuth;
  698. DWORD NotZone;
  699. DWORD RefusedNonSecure;
  700. DWORD RefusedAccessDenied;
  701. DWORD SecureSuccess;
  702. DWORD SecureContinue;
  703. DWORD SecureFailure;
  704. DWORD SecureDsWriteFailure;
  705. DWORD DsSuccess;
  706. DWORD DsWriteFailure;
  707. DWORD unused_was_Collisions;
  708. DWORD unused_was_CollisionsRead;
  709. DWORD unused_was_CollisionsWrite;
  710. DWORD unused_was_CollisionsDsWrite;
  711. DWORD Queued;
  712. DWORD Retry;
  713. DWORD Timeout;
  714. DWORD InQueue;
  715. DWORD Forwards;
  716. DWORD TcpForwards;
  717. DWORD ForwardResponses;
  718. DWORD ForwardTimeouts;
  719. DWORD ForwardInQueue;
  720. DWORD UpdateType[ STATS_TYPE_MAX+1 ];
  721. }
  722. DNSSRV_UPDATE_STATS, *PDNSSRV_UPDATE_STATS;
  723. typedef struct _DnsSkwansecStats
  724. {
  725. DNSSRV_STAT_HEADER Header;
  726. DWORD SecContextCreate;
  727. DWORD SecContextFree;
  728. DWORD SecContextQueue;
  729. DWORD SecContextQueueInNego;
  730. DWORD SecContextQueueNegoComplete;
  731. DWORD SecContextQueueLength;
  732. DWORD SecContextDequeue;
  733. DWORD SecContextTimeout;
  734. DWORD SecPackAlloc;
  735. DWORD SecPackFree;
  736. DWORD SecTkeyInvalid;
  737. DWORD SecTkeyBadTime;
  738. DWORD SecTsigFormerr;
  739. DWORD SecTsigEcho;
  740. DWORD SecTsigBadKey;
  741. DWORD SecTsigVerifySuccess;
  742. DWORD SecTsigVerifyFailed;
  743. }
  744. DNSSRV_SKWANSEC_STATS, *PDNSSRV_SKWANSEC_STATS;
  745. //
  746. // DS Integration Stats
  747. //
  748. typedef struct _DnsDsStats
  749. {
  750. DNSSRV_STAT_HEADER Header;
  751. DWORD DsTotalNodesRead;
  752. DWORD DsTotalRecordsRead;
  753. DWORD DsNodesLoaded;
  754. DWORD DsRecordsLoaded;
  755. DWORD DsTombstonesRead;
  756. DWORD DsUpdateSearches;
  757. DWORD DsUpdateNodesRead;
  758. DWORD DsUpdateRecordsRead;
  759. // Update writes
  760. DWORD UpdateLists;
  761. DWORD UpdateNodes;
  762. DWORD UpdateSuppressed;
  763. DWORD UpdateWrites;
  764. DWORD UpdateTombstones;
  765. DWORD UpdateRecordChange;
  766. DWORD UpdateAgingRefresh;
  767. DWORD UpdateAgingOn;
  768. DWORD UpdateAgingOff;
  769. DWORD UpdatePacket;
  770. DWORD UpdatePacketPrecon;
  771. DWORD UpdateAdmin;
  772. DWORD UpdateAutoConfig;
  773. DWORD UpdateScavenge;
  774. // DS writes
  775. DWORD DsNodesAdded;
  776. DWORD DsNodesModified;
  777. DWORD DsNodesTombstoned;
  778. DWORD DsNodesDeleted;
  779. DWORD DsRecordsAdded;
  780. DWORD DsRecordsReplaced;
  781. DWORD DsWriteSuppressed;
  782. DWORD DsSerialWrites;
  783. // Time stats in ldap calls
  784. DWORD LdapTimedWrites;
  785. DWORD LdapWriteTimeTotal;
  786. DWORD LdapWriteAverage;
  787. DWORD LdapWriteMax;
  788. DWORD LdapWriteBucket0;
  789. DWORD LdapWriteBucket1;
  790. DWORD LdapWriteBucket2;
  791. DWORD LdapWriteBucket3;
  792. DWORD LdapWriteBucket4;
  793. DWORD LdapWriteBucket5;
  794. DWORD LdapSearchTime;
  795. // Failures
  796. DWORD FailedDeleteDsEntries;
  797. DWORD FailedReadRecords;
  798. DWORD FailedLdapModify;
  799. DWORD FailedLdapAdd;
  800. // Polling stats
  801. DWORD PollingPassesWithDsErrors;
  802. // DS Write Stats
  803. DWORD DsWriteType[ STATS_TYPE_MAX+1 ];
  804. }
  805. DNSSRV_DS_STATS, *PDNSSRV_DS_STATS;
  806. //
  807. // Memory stats
  808. //
  809. // Note, memory stats have been added since NT5 ship
  810. // so maintain NT5 and current memory stats with
  811. // separate IDs. See next section for NT5 memory stats
  812. //
  813. //
  814. // Memory Tags -- post NT5 ordering
  815. //
  816. #define MEMTAG_CURRENT_VERSION (5)
  817. #define MEMTAG_NONE 0
  818. #define MEMTAG_PACKET_UDP 1
  819. #define MEMTAG_PACKET_TCP 2
  820. #define MEMTAG_NAME 3
  821. #define MEMTAG_ZONE 4
  822. #define MEMTAG_UPDATE 5
  823. #define MEMTAG_UPDATE_LIST 6
  824. #define MEMTAG_TIMEOUT 7
  825. #define MEMTAG_NODEHASH 8
  826. #define MEMTAG_DS_DN 9
  827. #define MEMTAG_DS_MOD 10
  828. #define MEMTAG_DS_RECORD 11
  829. #define MEMTAG_DS_OTHER 12
  830. #define MEMTAG_THREAD 13
  831. #define MEMTAG_NBSTAT 14
  832. #define MEMTAG_DNSLIB 15
  833. #define MEMTAG_TABLE 16
  834. #define MEMTAG_SOCKET 17
  835. #define MEMTAG_CONNECTION 18
  836. #define MEMTAG_REGISTRY 19
  837. #define MEMTAG_RPC 20
  838. #define MEMTAG_STUFF 21
  839. #define MEMTAG_FILEBUF 22
  840. #define MEMTAG_REMOTE 23
  841. #define MEMTAG_EVTCTRL 24
  842. #define MEMTAG_SAFE 25
  843. //
  844. // Record and Node sources
  845. //
  846. #define SRCTAG_UNKNOWN (0)
  847. #define SRCTAG_FILE (1)
  848. #define SRCTAG_DS (2)
  849. #define SRCTAG_AXFR (3)
  850. #define SRCTAG_IXFR (4)
  851. #define SRCTAG_DYNUP (5)
  852. #define SRCTAG_ADMIN (6)
  853. #define SRCTAG_AUTO (7)
  854. #define SRCTAG_CACHE (8)
  855. #define SRCTAG_NOEXIST (9)
  856. #define SRCTAG_WINS (10)
  857. #define SRCTAG_WINSPTR (11)
  858. #define SRCTAG_COPY (12)
  859. #define SRCTAG_MAX (SRCTAG_COPY) // 12
  860. //
  861. // Record tags
  862. //
  863. // Start after last memtag.
  864. // Use source tags to index off of MEMTAG_RECORD base.
  865. //
  866. #define MEMTAG_RECORD_BASE (MEMTAG_SAFE+1) // 25
  867. #define MEMTAG_RECORD (MEMTAG_RECORD_BASE) // 25
  868. #define MEMTAG_RECORD_UNKNOWN (MEMTAG_RECORD + SRCTAG_UNKNOWN ) // 25
  869. #define MEMTAG_RECORD_FILE (MEMTAG_RECORD + SRCTAG_FILE ) // 26
  870. #define MEMTAG_RECORD_DS (MEMTAG_RECORD + SRCTAG_DS )
  871. #define MEMTAG_RECORD_AXFR (MEMTAG_RECORD + SRCTAG_AXFR )
  872. #define MEMTAG_RECORD_IXFR (MEMTAG_RECORD + SRCTAG_IXFR )
  873. #define MEMTAG_RECORD_DYNUP (MEMTAG_RECORD + SRCTAG_DYNUP ) // 30
  874. #define MEMTAG_RECORD_ADMIN (MEMTAG_RECORD + SRCTAG_ADMIN )
  875. #define MEMTAG_RECORD_AUTO (MEMTAG_RECORD + SRCTAG_AUTO )
  876. #define MEMTAG_RECORD_CACHE (MEMTAG_RECORD + SRCTAG_CACHE )
  877. #define MEMTAG_RECORD_NOEXIST (MEMTAG_RECORD + SRCTAG_NOEXIST )
  878. #define MEMTAG_RECORD_WINS (MEMTAG_RECORD + SRCTAG_WINS ) // 35
  879. #define MEMTAG_RECORD_WINSPTR (MEMTAG_RECORD + SRCTAG_WINSPTR )
  880. #define MEMTAG_RECORD_COPY (MEMTAG_RECORD + SRCTAG_COPY ) // 37
  881. #define MEMTAG_RECORD_MAX MEMTAG_RECORD_COPY // 38
  882. //
  883. // Node tags
  884. //
  885. #define MEMTAG_NODE (MEMTAG_RECORD_MAX + 1) // 39
  886. #define MEMTAG_NODE_UNKNOWN (MEMTAG_NODE + SRCTAG_UNKNOWN ) // 39
  887. #define MEMTAG_NODE_FILE (MEMTAG_NODE + SRCTAG_FILE ) // 40
  888. #define MEMTAG_NODE_DS (MEMTAG_NODE + SRCTAG_DS )
  889. #define MEMTAG_NODE_AXFR (MEMTAG_NODE + SRCTAG_AXFR )
  890. #define MEMTAG_NODE_IXFR (MEMTAG_NODE + SRCTAG_IXFR )
  891. #define MEMTAG_NODE_DYNUP (MEMTAG_NODE + SRCTAG_DYNUP )
  892. #define MEMTAG_NODE_ADMIN (MEMTAG_NODE + SRCTAG_ADMIN ) // 45
  893. #define MEMTAG_NODE_AUTO (MEMTAG_NODE + SRCTAG_AUTO )
  894. #define MEMTAG_NODE_CACHE (MEMTAG_NODE + SRCTAG_CACHE )
  895. #define MEMTAG_NODE_NOEXIST (MEMTAG_NODE + SRCTAG_NOEXIST )
  896. #define MEMTAG_NODE_WINS (MEMTAG_NODE + SRCTAG_WINS )
  897. #define MEMTAG_NODE_WINSPTR (MEMTAG_NODE + SRCTAG_WINSPTR ) // 50
  898. #define MEMTAG_NODE_COPY (MEMTAG_NODE + SRCTAG_COPY ) // 51
  899. #define MEMTAG_NODE_MAX MEMTAG_NODE_COPY // 51
  900. // Final MemTag values
  901. #define MEMTAG_MAX MEMTAG_NODE_MAX // 51
  902. #define MEMTAG_COUNT (MEMTAG_MAX+1) // 52
  903. //
  904. // Memory Tag Names
  905. //
  906. // Note: DNS client print module (print.c) keeps memtag name table
  907. // based on these #defines; that table MUST be kept in same
  908. // order as actual memtag indexes for printing to be accurate
  909. //
  910. #define MEMTAG_NAME_NONE ("None")
  911. #define MEMTAG_NAME_PACKET_UDP ("UDP Packet")
  912. #define MEMTAG_NAME_PACKET_TCP ("TCP Packet")
  913. #define MEMTAG_NAME_NAME ("Name")
  914. #define MEMTAG_NAME_ZONE ("Zone")
  915. #define MEMTAG_NAME_UPDATE ("Update")
  916. #define MEMTAG_NAME_UPDATE_LIST ("Update List")
  917. #define MEMTAG_NAME_TIMEOUT ("Timeout")
  918. #define MEMTAG_NAME_NODEHASH ("Node Hash")
  919. #define MEMTAG_NAME_DS_DN ("DS DN")
  920. #define MEMTAG_NAME_DS_MOD ("DS Mod")
  921. #define MEMTAG_NAME_DS_RECORD ("DS Record")
  922. #define MEMTAG_NAME_DS_OTHER ("DS Other")
  923. #define MEMTAG_NAME_THREAD ("Thread")
  924. #define MEMTAG_NAME_NBSTAT ("Nbstat")
  925. #define MEMTAG_NAME_DNSLIB ("DnsLib")
  926. #define MEMTAG_NAME_TABLE ("Table")
  927. #define MEMTAG_NAME_SOCKET ("Socket")
  928. #define MEMTAG_NAME_CONNECTION ("TCP Connection")
  929. #define MEMTAG_NAME_REGISTRY ("Registry")
  930. #define MEMTAG_NAME_RPC ("RPC")
  931. #define MEMTAG_NAME_STUFF ("Stuff")
  932. #define MEMTAG_NAME_FILEBUF ("File Buffer")
  933. #define MEMTAG_NAME_REMOTE ("Remote IP")
  934. #define MEMTAG_NAME_EVTCTRL ("Event Control")
  935. #define MEMTAG_NAME_SAFE ("Safe")
  936. #define MEMTAG_NAME_RECORD ("Record")
  937. #define MEMTAG_NAME_RECORD_FILE ("RR File")
  938. #define MEMTAG_NAME_RECORD_DS ("RR DS")
  939. #define MEMTAG_NAME_RECORD_AXFR ("RR AXFR")
  940. #define MEMTAG_NAME_RECORD_IXFR ("RR IXFR")
  941. #define MEMTAG_NAME_RECORD_DYNUP ("RR Update")
  942. #define MEMTAG_NAME_RECORD_ADMIN ("RR Admin")
  943. #define MEMTAG_NAME_RECORD_AUTO ("RR Auto")
  944. #define MEMTAG_NAME_RECORD_CACHE ("RR Cache")
  945. #define MEMTAG_NAME_RECORD_NOEXIST ("RR NoExist")
  946. #define MEMTAG_NAME_RECORD_WINS ("RR WINS")
  947. #define MEMTAG_NAME_RECORD_WINSPTR ("RR WINS-PTR")
  948. #define MEMTAG_NAME_RECORD_COPY ("RR Copy")
  949. #define MEMTAG_NAME_NODE ("Node")
  950. #define MEMTAG_NAME_NODE_FILE ("Node File")
  951. #define MEMTAG_NAME_NODE_DS ("Node DS")
  952. #define MEMTAG_NAME_NODE_AXFR ("Node AXFR")
  953. #define MEMTAG_NAME_NODE_IXFR ("Node IXFR")
  954. #define MEMTAG_NAME_NODE_DYNUP ("Node Update")
  955. #define MEMTAG_NAME_NODE_ADMIN ("Node Admin")
  956. #define MEMTAG_NAME_NODE_AUTO ("Node Auto")
  957. #define MEMTAG_NAME_NODE_CACHE ("Node Cache")
  958. #define MEMTAG_NAME_NODE_NOEXIST ("Node NoExist")
  959. #define MEMTAG_NAME_NODE_WINS ("Node WINS")
  960. #define MEMTAG_NAME_NODE_WINSPTR ("Node WINS-PTR")
  961. #define MEMTAG_NAME_NODE_COPY ("Node Copy")
  962. // Individual memory counter
  963. typedef struct _DnsMemoryTagStats
  964. {
  965. DWORD Alloc;
  966. DWORD Free;
  967. DWORD Memory;
  968. }
  969. MEMTAG_STATS, *PMEMTAG_STATS;
  970. // Memory stat block
  971. typedef struct _DnsMemoryStats
  972. {
  973. DNSSRV_STAT_HEADER Header;
  974. DWORD Memory;
  975. DWORD Alloc;
  976. DWORD Free;
  977. DWORD StdUsed;
  978. DWORD StdReturn;
  979. DWORD StdInUse;
  980. DWORD StdMemory;
  981. DWORD StdToHeapAlloc;
  982. DWORD StdToHeapFree;
  983. DWORD StdToHeapInUse;
  984. DWORD StdToHeapMemory;
  985. DWORD StdBlockAlloc;
  986. DWORD StdBlockUsed;
  987. DWORD StdBlockReturn;
  988. DWORD StdBlockInUse;
  989. DWORD StdBlockFreeList;
  990. DWORD StdBlockFreeListMemory;
  991. DWORD StdBlockMemory;
  992. MEMTAG_STATS MemTags[ MEMTAG_COUNT ];
  993. }
  994. DNSSRV_MEMORY_STATS, *PDNSSRV_MEMORY_STATS;
  995. //
  996. // Packet stats
  997. //
  998. typedef struct _DnsPacketStats
  999. {
  1000. DNSSRV_STAT_HEADER Header;
  1001. DWORD UdpAlloc;
  1002. DWORD UdpFree;
  1003. DWORD UdpNetAllocs;
  1004. DWORD UdpMemory;
  1005. DWORD UdpUsed;
  1006. DWORD UdpReturn;
  1007. DWORD UdpResponseReturn;
  1008. DWORD UdpQueryReturn;
  1009. DWORD UdpInUse;
  1010. DWORD UdpInFreeList;
  1011. DWORD TcpAlloc;
  1012. DWORD TcpRealloc;
  1013. DWORD TcpFree;
  1014. DWORD TcpNetAllocs;
  1015. DWORD TcpMemory;
  1016. DWORD RecursePacketUsed;
  1017. DWORD RecursePacketReturn;
  1018. DWORD UdpPacketsForNsListUsed;
  1019. DWORD UdpPacketsForNsListReturned;
  1020. DWORD UdpPacketsForNsListInUse;
  1021. }
  1022. DNSSRV_PACKET_STATS, *PDNSSRV_PACKET_STATS;
  1023. //
  1024. // Timeout stats
  1025. //
  1026. typedef struct _DnsTimeoutStats
  1027. {
  1028. DNSSRV_STAT_HEADER Header;
  1029. DWORD SetTotal;
  1030. DWORD SetDirect;
  1031. DWORD SetFromDereference;
  1032. DWORD SetFromChildDelete;
  1033. DWORD AlreadyInSystem;
  1034. DWORD Checks;
  1035. DWORD RecentAccess;
  1036. DWORD ActiveRecord;
  1037. DWORD CanNotDelete;
  1038. DWORD Deleted;
  1039. DWORD ArrayBlocksCreated;
  1040. DWORD ArrayBlocksDeleted;
  1041. DWORD DelayedFreesQueued;
  1042. DWORD DelayedFreesQueuedWithFunction;
  1043. DWORD DelayedFreesExecuted;
  1044. DWORD DelayedFreesExecutedWithFunction;
  1045. }
  1046. DNSSRV_TIMEOUT_STATS, *PDNSSRV_TIMEOUT_STATS;
  1047. //
  1048. // Database Stats
  1049. //
  1050. typedef struct _DnsDbaseStats
  1051. {
  1052. DNSSRV_STAT_HEADER Header;
  1053. DWORD NodeMemory;
  1054. DWORD NodeInUse;
  1055. DWORD NodeUsed;
  1056. DWORD NodeReturn;
  1057. }
  1058. DNSSRV_DBASE_STATS, *PDNSSRV_DBASE_STATS;
  1059. //
  1060. // Record stats
  1061. //
  1062. // DCR: add type info (inc name error)
  1063. //
  1064. typedef struct _DnsRecordStats
  1065. {
  1066. DNSSRV_STAT_HEADER Header;
  1067. DWORD InUse;
  1068. DWORD Used;
  1069. DWORD Return;
  1070. DWORD Memory;
  1071. DWORD CacheTotal;
  1072. DWORD CacheCurrent;
  1073. DWORD CacheTimeouts;
  1074. DWORD SlowFreeQueued;
  1075. DWORD SlowFreeFinished;
  1076. }
  1077. DNSSRV_RECORD_STATS, *PDNSSRV_RECORD_STATS;
  1078. //
  1079. // Nbstat memory stats
  1080. //
  1081. typedef struct _DnsNbstatStats
  1082. {
  1083. DNSSRV_STAT_HEADER Header;
  1084. DWORD NbstatAlloc;
  1085. DWORD NbstatFree;
  1086. DWORD NbstatNetAllocs;
  1087. DWORD NbstatMemory;
  1088. DWORD NbstatUsed;
  1089. DWORD NbstatReturn;
  1090. DWORD NbstatInUse;
  1091. DWORD NbstatInFreeList;
  1092. }
  1093. DNSSRV_NBSTAT_STATS, *PDNSSRV_NBSTAT_STATS;
  1094. //
  1095. // Private stats
  1096. //
  1097. //
  1098. // Private stats
  1099. //
  1100. typedef struct _DnsPrivateStats
  1101. {
  1102. DNSSRV_STAT_HEADER Header;
  1103. DWORD RecordFile;
  1104. DWORD RecordFileFree;
  1105. DWORD RecordDs;
  1106. DWORD RecordDsFree;
  1107. DWORD RecordAdmin;
  1108. DWORD RecordAdminFree;
  1109. DWORD RecordDynUp;
  1110. DWORD RecordDynUpFree;
  1111. DWORD RecordAxfr;
  1112. DWORD RecordAxfrFree;
  1113. DWORD RecordIxfr;
  1114. DWORD RecordIxfrFree;
  1115. DWORD RecordCopy;
  1116. DWORD RecordCopyFree;
  1117. DWORD RecordCache;
  1118. DWORD RecordCacheFree;
  1119. DWORD UdpSocketPnpDelete;
  1120. DWORD UdpRecvFailure;
  1121. DWORD UdpErrorMessageSize;
  1122. DWORD UdpConnResets;
  1123. DWORD UdpConnResetRetryOverflow;
  1124. DWORD UdpGQCSFailure;
  1125. DWORD UdpGQCSFailureWithContext;
  1126. DWORD UdpGQCSConnReset;
  1127. DWORD UdpIndicateRecvFailures;
  1128. DWORD UdpRestartRecvOnSockets;
  1129. DWORD TcpConnectAttempt;
  1130. DWORD TcpConnectFailure;
  1131. DWORD TcpConnect;
  1132. DWORD TcpQuery;
  1133. DWORD TcpDisconnect;
  1134. DWORD SecTsigVerifyOldSig;
  1135. DWORD SecTsigVerifyOldFailed;
  1136. DWORD SecBigTimeSkewBypass;
  1137. DWORD ZoneLoadInit;
  1138. DWORD ZoneLoadComplete;
  1139. DWORD ZoneDbaseDelete;
  1140. DWORD ZoneDbaseDelayedDelete;
  1141. }
  1142. DNSSRV_PRIVATE_STATS, *PDNSSRV_PRIVATE_STATS;
  1143. //
  1144. // Private stats -- post NT5
  1145. //
  1146. // We should dump a bunch of private stats and add
  1147. // others -- but not there yet.
  1148. //
  1149. #if 0
  1150. typedef struct _DnsPrivateStats
  1151. {
  1152. DNSSRV_STAT_HEADER Header;
  1153. DWORD UdpSocketPnpDelete;
  1154. DWORD UdpRecvFailure;
  1155. DWORD UdpErrorMessageSize;
  1156. DWORD UdpConnResets;
  1157. DWORD UdpConnResetRetryOverflow;
  1158. DWORD UdpGQCSFailure;
  1159. DWORD UdpGQCSFailureWithContext;
  1160. DWORD UdpGQCSConnReset;
  1161. DWORD UdpIndicateRecvFailures;
  1162. DWORD UdpRestartRecvOnSockets;
  1163. DWORD TcpConnectAttempt;
  1164. DWORD TcpConnectFailure;
  1165. DWORD TcpConnect;
  1166. DWORD TcpQuery;
  1167. DWORD TcpDisconnect;
  1168. DWORD SecTsigVerifyOldSig;
  1169. DWORD SecTsigVerifyOldFailed;
  1170. DWORD SecBigTimeSkewBypass;
  1171. DWORD ZoneLoadInit;
  1172. DWORD ZoneLoadComplete;
  1173. DWORD ZoneDbaseDelete;
  1174. DWORD ZoneDbaseDelayedDelete;
  1175. }
  1176. DNSSRV_PRIVATE_STATS, *PDNSSRV_PRIVATE_STATS;
  1177. #endif
  1178. //
  1179. // Discontinued
  1180. //
  1181. typedef struct _DnsXfrStats
  1182. {
  1183. DNSSRV_STAT_HEADER Header;
  1184. DWORD SecSoaQueries;
  1185. DWORD SecSoaResponses;
  1186. DWORD SecNotifyReceived;
  1187. DWORD SecAxfrRequested;
  1188. DWORD SecAxfrRejected;
  1189. DWORD SecAxfrFailed;
  1190. DWORD SecAxfrSuccessful;
  1191. DWORD MasterNotifySent;
  1192. DWORD MasterAxfrReceived;
  1193. DWORD MasterAxfrInvalid;
  1194. DWORD MasterAxfrRefused;
  1195. DWORD MasterAxfrDenied;
  1196. DWORD MasterAxfrFailed;
  1197. DWORD MasterAxfrSuccessful;
  1198. }
  1199. DNSSRV_XFR_STATS, *PDNSSRV_XFR_STATS;
  1200. typedef struct _ErrorStats
  1201. {
  1202. DNSSRV_STAT_HEADER Header;
  1203. DWORD NoError;
  1204. DWORD FormError;
  1205. DWORD ServFail;
  1206. DWORD NxDomain;
  1207. DWORD NotImpl;
  1208. DWORD Refused;
  1209. DWORD YxDomain;
  1210. DWORD YxRRSet;
  1211. DWORD NxRRSet;
  1212. DWORD NotAuth;
  1213. DWORD NotZone;
  1214. DWORD Max;
  1215. DWORD BadSig;
  1216. DWORD BadKey;
  1217. DWORD BadTime;
  1218. DWORD UnknownError;
  1219. }
  1220. DNSSRV_ERROR_STATS, *PDNSSRV_ERROR_STATS;
  1221. //
  1222. // Cache stats - new for Whistler
  1223. //
  1224. typedef struct _DnsCacheStats
  1225. {
  1226. DNSSRV_STAT_HEADER Header;
  1227. DWORD CacheExceededLimitChecks;
  1228. DWORD SuccessfulFreePasses;
  1229. DWORD FailedFreePasses;
  1230. DWORD PassesWithNoFrees;
  1231. DWORD PassesRequiringAggressiveFree;
  1232. }
  1233. DNSSRV_CACHE_STATS, *PDNSSRV_CACHE_STATS;
  1234. //
  1235. // Stat IDs
  1236. // - request all stats by sending (-1)
  1237. //
  1238. // Stat Versioning
  1239. // Policy on stat versioning will be to use the top byte
  1240. // of the statid as a version field which rolls on individual
  1241. // release. In general we should probably try to keep this
  1242. // in ssync across stats from a particular release to allow
  1243. // at some point to make decisions based on the stat id.
  1244. // May want to rejigger IDs -- compact ongoing ones at bottom.
  1245. //
  1246. // Note: obviously i'm abandoning the original idea of bit
  1247. // field ids and allowing mask in stat request, as we'd quickly
  1248. // exhaust stat store. This change has already been made in
  1249. // dnscmd.exe documentation.
  1250. //
  1251. #define DNSSRV_STATID_TIME (0x00000001)
  1252. #define DNSSRV_STATID_QUERY (0x00000002)
  1253. #define DNSSRV_STATID_QUERY2 (0x00000004)
  1254. #define DNSSRV_STATID_RECURSE (0x00000008)
  1255. #define DNSSRV_STATID_MASTER (0x01000010)
  1256. #define DNSSRV_STATID_SECONDARY (0x01000020)
  1257. #define DNSSRV_STATID_WINS (0x00000040)
  1258. #define DNSSRV_STATID_WIRE_UPDATE (0x00000100)
  1259. #define DNSSRV_STATID_SKWANSEC (0x00000200)
  1260. #define DNSSRV_STATID_DS (0x00000400)
  1261. #define DNSSRV_STATID_NONWIRE_UPDATE (0x00000800)
  1262. #define DNSSRV_STATID_MEMORY (0x01010000)
  1263. #define DNSSRV_STATID_TIMEOUT (0x00020000)
  1264. #define DNSSRV_STATID_DBASE (0x00040000)
  1265. #define DNSSRV_STATID_RECORD (0x00080000)
  1266. #define DNSSRV_STATID_PACKET (0x00100000)
  1267. #define DNSSRV_STATID_NBSTAT (0x00200000)
  1268. #define DNSSRV_STATID_ERRORS (0x00400000)
  1269. #define DNSSRV_STATID_CACHE (0x00800000)
  1270. #define DNSSRV_STATID_PRIVATE (0x10000000)
  1271. #define DNSSRV_STATID_ALL (0xffffffff)
  1272. //
  1273. // Statistics API
  1274. //
  1275. DNS_STATUS
  1276. DNS_API_FUNCTION
  1277. DnssrvGetStatistics(
  1278. IN LPCWSTR pwszServer,
  1279. IN DWORD dwFilter,
  1280. OUT PDNS_RPC_BUFFER * ppStatsBuffer
  1281. );
  1282. DNS_STATUS
  1283. DNS_API_FUNCTION
  1284. DnssrvClearStatistics(
  1285. IN LPCWSTR pwszServer
  1286. );
  1287. PDNSSRV_STAT
  1288. DNS_API_FUNCTION
  1289. DnssrvFindStatisticsInBuffer(
  1290. IN PDNS_RPC_BUFFER pBuffer,
  1291. IN DWORD StatId
  1292. );
  1293. #define DnssrvFreeStatisticsBuffer( pBuf ) \
  1294. DnssrvFreeRpcBuffer( (PDNS_RPC_BUFFER)pBuf )
  1295. DNS_STATUS
  1296. DNS_API_FUNCTION
  1297. DnssrvValidityCheckStatistic(
  1298. IN PDNSSRV_STAT pStat
  1299. );
  1300. //
  1301. // Server information
  1302. //
  1303. // Auto create delegations (ACD) settings
  1304. #define DNS_ACD_DONT_CREATE 0
  1305. #define DNS_ACD_ALWAYS_CREATE 1
  1306. #define DNS_ACD_ONLY_IF_NO_DELEGATION_IN_PARENT 2
  1307. // EnableDnsSec values
  1308. #define DNS_DNSSEC_DISABLED 0
  1309. #define DNS_DNSSEC_ENABLED_IF_EDNS 1
  1310. #define DNS_DNSSEC_ENABLED_ALWAYS 2
  1311. // LocalNetPriorityNetMask values
  1312. // ZERO: sort by closest match down to the last bit
  1313. // ALL ONES: sort by closest match down to the network class default subnet mask
  1314. // OTHER: sort down to this netmask - e.g. 0xFF means sort down the class C
  1315. #define DNS_LOCNETPRI_MASK_BEST_MATCH 0
  1316. #define DNS_LOCNETPRI_MASK_CLASS_DEFAULT 0xFFFFFFFF
  1317. //
  1318. // Zone information
  1319. //
  1320. // Zone types
  1321. #define DNS_ZONE_TYPE_CACHE (0)
  1322. #define DNS_ZONE_TYPE_PRIMARY (1)
  1323. #define DNS_ZONE_TYPE_SECONDARY (2)
  1324. #define DNS_ZONE_TYPE_STUB (3) // specialized form of SECONDARY
  1325. #define DNS_ZONE_TYPE_FORWARDER (4) // another specialized zone type
  1326. // Zone request filters
  1327. #define ZONE_REQUEST_PRIMARY 0x00000001
  1328. #define ZONE_REQUEST_SECONDARY 0x00000002
  1329. #define ZONE_REQUEST_CACHE 0x00000004
  1330. #define ZONE_REQUEST_AUTO 0x00000008
  1331. #define ZONE_REQUEST_FORWARD 0x00000010
  1332. #define ZONE_REQUEST_REVERSE 0x00000020
  1333. #define ZONE_REQUEST_FORWARDER 0x00000040
  1334. #define ZONE_REQUEST_STUB 0x00000080
  1335. #define ZONE_REQUEST_DS 0x00000100
  1336. #define ZONE_REQUEST_NON_DS 0x00000200
  1337. #define ZONE_REQUEST_ANY_TYPE 0x000000C7
  1338. #define ZONE_REQUEST_ANY_DIRECTION 0x00000030
  1339. #define ZONE_REQUEST_ANY_DATABASE 0x00000300
  1340. #define ZONE_REQUEST_ALL_ZONES 0xfffffffb
  1341. #define ZONE_REQUEST_ALL_ZONES_AND_CACHE 0xffffffff
  1342. // Zone update properties
  1343. #define ZONE_UPDATE_OFF (0)
  1344. #define ZONE_UPDATE_UNSECURE (1)
  1345. #define ZONE_UPDATE_SECURE (2)
  1346. #define ZONE_UPDATE_SECURE_RFC (3)
  1347. // Zone notify levels
  1348. #define ZONE_NOTIFY_OFF (0)
  1349. #define ZONE_NOTIFY_ALL_SECONDARIES (1)
  1350. #define ZONE_NOTIFY_LIST_ONLY (2)
  1351. #define ZONE_NOTIFY_HIGHEST_VALUE ZONE_NOTIFY_LIST_ONLY
  1352. #if 1
  1353. #define ZONE_NOTIFY_ALL ZONE_NOTIFY_ALL_SECONDARIES
  1354. #define ZONE_NOTIFY_LIST ZONE_NOTIFY_LIST_ONLY
  1355. #endif
  1356. // Zone secondary security
  1357. #define ZONE_SECSECURE_NO_SECURITY (0)
  1358. #define ZONE_SECSECURE_NS_ONLY (1)
  1359. #define ZONE_SECSECURE_LIST_ONLY (2)
  1360. #define ZONE_SECSECURE_NO_XFR (3)
  1361. #define ZONE_SECSECURE_HIGHEST_VALUE ZONE_SECSECURE_NO_XFR
  1362. #if 1
  1363. #define ZONE_SECSECURE_OFF ZONE_SECSECURE_NO_SECURITY
  1364. #define ZONE_SECSECURE_NS ZONE_SECSECURE_NS_ONLY
  1365. #define ZONE_SECSECURE_LIST ZONE_SECSECURE_LIST_ONLY
  1366. #define ZONE_SECSECURE_NONE ZONE_SECSECURE_NO_XFR
  1367. #endif
  1368. // No-Reset flag
  1369. // Indicates a specific property is NOT being reset in a multi-property
  1370. // reset call.
  1371. #define ZONE_PROPERTY_NORESET (0xbbbbbbbb)
  1372. //
  1373. // Special "zones" for Enum and Update
  1374. //
  1375. #define DNS_ZONE_ROOT_HINTS ("..RootHints")
  1376. #define DNS_ZONE_CACHE ("..Cache")
  1377. //
  1378. // Special "multizones" for zone operations
  1379. //
  1380. // These are provided for ease of use from dnscmd.exe.
  1381. // However, recommended approach is to use
  1382. // DNS_ZONE_ALL
  1383. // and use specific ZONE_REQUEST_XYZ flags above to specify
  1384. // matching zones.
  1385. //
  1386. #define DNS_ZONE_ALL ("..AllZones")
  1387. #define DNS_ZONE_ALL_AND_CACHE ("..AllZonesAndCache")
  1388. #define DNS_ZONE_ALL_PRIMARY ("..AllPrimaryZones")
  1389. #define DNS_ZONE_ALL_SECONDARY ("..AllSecondaryZones")
  1390. #define DNS_ZONE_ALL_FORWARD ("..AllForwardZones")
  1391. #define DNS_ZONE_ALL_REVERSE ("..AllReverseZones")
  1392. #define DNS_ZONE_ALL_DS ("..AllDsZones")
  1393. #define DNS_ZONE_ALL_NON_DS ("..AllNonDsZones")
  1394. // useful combinations
  1395. #define DNS_ZONE_ALL_PRIMARY_REVERSE ("..AllPrimaryReverseZones")
  1396. #define DNS_ZONE_ALL_PRIMARY_FORWARD ("..AllPrimaryForwardZones")
  1397. #define DNS_ZONE_ALL_SECONDARY_REVERSE ("..AllSecondaryReverseZones")
  1398. #define DNS_ZONE_ALL_SECONDARY_FORWARD ("..AllSecondaryForwardZones")
  1399. //
  1400. // Basic zone data
  1401. // - provides what admin tool needs to show zone list
  1402. //
  1403. typedef struct _DnssrvRpcZoneFlags
  1404. {
  1405. DWORD Paused : 1;
  1406. DWORD Shutdown : 1;
  1407. DWORD Reverse : 1;
  1408. DWORD AutoCreated : 1;
  1409. DWORD DsIntegrated : 1;
  1410. DWORD Aging : 1;
  1411. DWORD Update : 2;
  1412. DWORD UnUsed : 24;
  1413. }
  1414. DNS_RPC_ZONE_FLAGS, *PDNS_RPC_ZONE_FLAGS;
  1415. typedef struct _DnssrvRpcZoneW2K
  1416. {
  1417. LPWSTR pszZoneName;
  1418. #ifdef MIDL_PASS
  1419. DWORD Flags;
  1420. #else
  1421. DNS_RPC_ZONE_FLAGS Flags;
  1422. #endif
  1423. UCHAR ZoneType;
  1424. UCHAR Version;
  1425. }
  1426. DNS_RPC_ZONE_W2K, *PDNS_RPC_ZONE_W2K;
  1427. typedef struct _DnssrvRpcZoneWhistler
  1428. {
  1429. DWORD dwRpcStuctureVersion;
  1430. DWORD dwReserved0;
  1431. LPWSTR pszZoneName;
  1432. #ifdef MIDL_PASS
  1433. DWORD Flags;
  1434. #else
  1435. DNS_RPC_ZONE_FLAGS Flags;
  1436. #endif
  1437. UCHAR ZoneType;
  1438. UCHAR Version;
  1439. //
  1440. // Directory partition where zone is stored
  1441. //
  1442. DWORD dwDpFlags;
  1443. LPSTR pszDpFqdn;
  1444. }
  1445. DNS_RPC_ZONE_WHISTLER, *PDNS_RPC_ZONE_WHISTLER;
  1446. //
  1447. // Zone enumeration
  1448. //
  1449. typedef struct _DnssrvRpcZoneListW2K
  1450. {
  1451. DWORD dwZoneCount;
  1452. #ifdef MIDL_PASS
  1453. [size_is(dwZoneCount)] PDNS_RPC_ZONE_W2K ZoneArray[];
  1454. #else
  1455. PDNS_RPC_ZONE_W2K ZoneArray[ 1 ]; // array of dwZoneCount zones
  1456. #endif
  1457. }
  1458. DNS_RPC_ZONE_LIST_W2K, *PDNS_RPC_ZONE_LIST_W2K;
  1459. typedef struct _DnssrvRpcZoneListWhistler
  1460. {
  1461. DWORD dwRpcStuctureVersion;
  1462. DWORD dwReserved0;
  1463. DWORD dwZoneCount;
  1464. #ifdef MIDL_PASS
  1465. [size_is(dwZoneCount)] PDNS_RPC_ZONE_WHISTLER ZoneArray[];
  1466. #else
  1467. PDNS_RPC_ZONE_WHISTLER ZoneArray[ 1 ]; // array of dwZoneCount zones
  1468. #endif
  1469. }
  1470. DNS_RPC_ZONE_LIST_WHISTLER, *PDNS_RPC_ZONE_LIST_WHISTLER;
  1471. //
  1472. // Directory partition enumeration and info
  1473. //
  1474. #define DNS_DP_AUTOCREATED 0x00000001
  1475. #define DNS_DP_LEGACY 0x00000002
  1476. #define DNS_DP_DOMAIN_DEFAULT 0x00000004
  1477. #define DNS_DP_FOREST_DEFAULT 0x00000008
  1478. #define DNS_DP_ENLISTED 0x00000010
  1479. #define DNS_DP_DELETED 0x00000020
  1480. #define DNS_DP_DOMAIN_STR "..DomainPartition"
  1481. #define DNS_DP_FOREST_STR "..ForestPartition"
  1482. #define DNS_DP_LEGACY_STR "..LegacyPartition"
  1483. typedef struct _DnssrvRpcDirectoryPartitionEnum
  1484. {
  1485. DWORD dwRpcStuctureVersion;
  1486. DWORD dwReserved0;
  1487. LPSTR pszDpFqdn;
  1488. DWORD dwFlags;
  1489. DWORD dwZoneCount;
  1490. }
  1491. DNS_RPC_DP_ENUM, *PDNS_RPC_DP_ENUM;
  1492. typedef struct _DnssrvRpcDirectoryPartitionList
  1493. {
  1494. DWORD dwRpcStuctureVersion;
  1495. DWORD dwReserved0;
  1496. DWORD dwDpCount;
  1497. #ifdef MIDL_PASS
  1498. [size_is(dwDpCount)] PDNS_RPC_DP_ENUM DpArray[];
  1499. #else
  1500. PDNS_RPC_DP_ENUM DpArray[ 1 ]; // array of dwDpCount pointers
  1501. #endif
  1502. }
  1503. DNS_RPC_DP_LIST, *PDNS_RPC_DP_LIST;
  1504. typedef struct _DnssrvRpcDirectoryPartitionReplica
  1505. {
  1506. LPWSTR pszReplicaDn;
  1507. }
  1508. DNS_RPC_DP_REPLICA, *PDNS_RPC_DP_REPLICA;
  1509. typedef struct _DnssrvRpcDirectoryPartition
  1510. {
  1511. DWORD dwRpcStuctureVersion;
  1512. DWORD dwReserved0;
  1513. LPSTR pszDpFqdn;
  1514. LPWSTR pszDpDn; // DP head DN
  1515. LPWSTR pszCrDn; // crossref DN
  1516. DWORD dwFlags;
  1517. DWORD dwZoneCount;
  1518. DWORD dwReplicaCount;
  1519. #ifdef MIDL_PASS
  1520. [size_is(dwReplicaCount)] PDNS_RPC_DP_REPLICA ReplicaArray[];
  1521. #else
  1522. PDNS_RPC_DP_REPLICA ReplicaArray[ 1 ]; // array of dwReplicaCount pointers
  1523. #endif
  1524. }
  1525. DNS_RPC_DP_INFO, *PDNS_RPC_DP_INFO;
  1526. //
  1527. // Enlist (or create) directory partition
  1528. //
  1529. #define DNS_DP_OP_MIN DNS_DP_OP_CREATE
  1530. #define DNS_DP_OP_CREATE 1 // create a new DP
  1531. #define DNS_DP_OP_DELETE 2 // delete an existing DP
  1532. #define DNS_DP_OP_ENLIST 3 // enlist this DC in an existing DP
  1533. #define DNS_DP_OP_UNENLIST 4 // unenlist this DC from a DP
  1534. #define DNS_DP_OP_CREATE_DOMAIN 5 // built-in domain DP
  1535. #define DNS_DP_OP_CREATE_FOREST 6 // built-in forest DP
  1536. #define DNS_DP_OP_CREATE_ALL_DOMAINS 7 // all domain DPs for the forest
  1537. #define DNS_DP_OP_MAX DNS_DP_OP_CREATE_ALL_DOMAINS
  1538. typedef struct _DnssrvRpcEnlistDirPart
  1539. {
  1540. DWORD dwRpcStuctureVersion;
  1541. DWORD dwReserved0;
  1542. LPSTR pszDpFqdn; // UTF8
  1543. DWORD dwOperation;
  1544. }
  1545. DNS_RPC_ENLIST_DP, *PDNS_RPC_ENLIST_DP;
  1546. //
  1547. // Zone rename
  1548. //
  1549. typedef struct _DnssrvRpcZoneRename
  1550. {
  1551. DWORD dwRpcStuctureVersion;
  1552. DWORD dwReserved0;
  1553. LPSTR pszNewZoneName;
  1554. LPSTR pszNewFileName;
  1555. }
  1556. DNS_RPC_ZONE_RENAME_INFO, *PDNS_RPC_ZONE_RENAME_INFO;
  1557. //
  1558. // Zone export
  1559. //
  1560. typedef struct _DnssrvRpcZoneExport
  1561. {
  1562. DWORD dwRpcStuctureVersion;
  1563. DWORD dwReserved0;
  1564. LPSTR pszZoneExportFile;
  1565. }
  1566. DNS_RPC_ZONE_EXPORT_INFO, *PDNS_RPC_ZONE_EXPORT_INFO;
  1567. //
  1568. // Zone property data
  1569. //
  1570. typedef struct _DnssrvRpcZoneTypeResetW2K
  1571. {
  1572. DWORD dwZoneType;
  1573. PIP_ARRAY aipMasters;
  1574. }
  1575. DNS_RPC_ZONE_TYPE_RESET_W2K, *PDNS_RPC_ZONE_TYPE_RESET_W2K;
  1576. typedef struct _DnssrvRpcZoneTypeResetWhistler
  1577. {
  1578. DWORD dwRpcStuctureVersion;
  1579. DWORD dwReserved0;
  1580. DWORD dwZoneType;
  1581. PIP_ARRAY aipMasters;
  1582. }
  1583. DNS_RPC_ZONE_TYPE_RESET_WHISTLER, *PDNS_RPC_ZONE_TYPE_RESET_WHISTLER;
  1584. typedef IP_ARRAY DNS_RPC_ZONE_MASTERS, *PDNS_RPC_ZONE_MASTERS;
  1585. typedef struct _DnssrvRpcZoneSecondariesW2K
  1586. {
  1587. DWORD fSecureSecondaries;
  1588. DWORD fNotifyLevel;
  1589. PIP_ARRAY aipSecondaries;
  1590. PIP_ARRAY aipNotify;
  1591. }
  1592. DNS_RPC_ZONE_SECONDARIES_W2K, *PDNS_RPC_ZONE_SECONDARIES_W2K;
  1593. typedef struct _DnssrvRpcZoneSecondariesWhistler
  1594. {
  1595. DWORD dwRpcStuctureVersion;
  1596. DWORD dwReserved0;
  1597. DWORD fSecureSecondaries;
  1598. DWORD fNotifyLevel;
  1599. PIP_ARRAY aipSecondaries;
  1600. PIP_ARRAY aipNotify;
  1601. }
  1602. DNS_RPC_ZONE_SECONDARIES_WHISTLER, *PDNS_RPC_ZONE_SECONDARIES_WHISTLER;
  1603. typedef struct _DnssrvRpcZoneDatabaseW2K
  1604. {
  1605. DWORD fDsIntegrated;
  1606. LPSTR pszFileName;
  1607. }
  1608. DNS_RPC_ZONE_DATABASE_W2K, *PDNS_RPC_ZONE_DATABASE_W2K;
  1609. typedef struct _DnssrvRpcZoneDatabaseWhistler
  1610. {
  1611. DWORD dwRpcStuctureVersion;
  1612. DWORD dwReserved0;
  1613. DWORD fDsIntegrated;
  1614. LPSTR pszFileName;
  1615. }
  1616. DNS_RPC_ZONE_DATABASE_WHISTLER, *PDNS_RPC_ZONE_DATABASE_WHISTLER;
  1617. //
  1618. // DNS_RPC_ZONE_CHANGE_DP - new for Whistler
  1619. //
  1620. // Used to move a zone from one directory parition (DP) to another.
  1621. //
  1622. // To move the zone to a built-in DP, for pszDestPartition use one of:
  1623. // DNS_DP_DOMAIN_STR
  1624. // DNS_DP_ENTERPRISE_STR
  1625. // DNS_DP_LEGACY_STR
  1626. //
  1627. typedef struct _DnssrvRpcZoneChangePartition
  1628. {
  1629. DWORD dwRpcStuctureVersion;
  1630. DWORD dwReserved0;
  1631. LPSTR pszDestPartition;
  1632. }
  1633. DNS_RPC_ZONE_CHANGE_DP, *PDNS_RPC_ZONE_CHANGE_DP;
  1634. typedef struct _DnsRpcZoneInfoW2K
  1635. {
  1636. LPSTR pszZoneName;
  1637. DWORD dwZoneType;
  1638. DWORD fReverse;
  1639. DWORD fAllowUpdate;
  1640. DWORD fPaused;
  1641. DWORD fShutdown;
  1642. DWORD fAutoCreated;
  1643. // Database info
  1644. DWORD fUseDatabase;
  1645. LPSTR pszDataFile;
  1646. // Masters
  1647. PIP_ARRAY aipMasters;
  1648. // Secondaries
  1649. DWORD fSecureSecondaries;
  1650. DWORD fNotifyLevel;
  1651. PIP_ARRAY aipSecondaries;
  1652. PIP_ARRAY aipNotify;
  1653. // WINS or Nbstat lookup
  1654. DWORD fUseWins;
  1655. DWORD fUseNbstat;
  1656. // Aging
  1657. DWORD fAging;
  1658. DWORD dwNoRefreshInterval;
  1659. DWORD dwRefreshInterval;
  1660. DWORD dwAvailForScavengeTime;
  1661. PIP_ARRAY aipScavengeServers;
  1662. // save some space, just in case
  1663. // avoid versioning issues if possible
  1664. DWORD pvReserved1;
  1665. DWORD pvReserved2;
  1666. DWORD pvReserved3;
  1667. DWORD pvReserved4;
  1668. }
  1669. DNS_RPC_ZONE_INFO_W2K, *PDNS_RPC_ZONE_INFO_W2K;
  1670. typedef DNS_RPC_ZONE_INFO_W2K DNS_ZONE_INFO_W2K, *PDNS_ZONE_INFO_W2K;
  1671. typedef struct _DnsRpcZoneInfoWhistler
  1672. {
  1673. DWORD dwRpcStuctureVersion;
  1674. DWORD dwReserved0;
  1675. LPSTR pszZoneName;
  1676. DWORD dwZoneType;
  1677. DWORD fReverse;
  1678. DWORD fAllowUpdate;
  1679. DWORD fPaused;
  1680. DWORD fShutdown;
  1681. DWORD fAutoCreated;
  1682. // Database info
  1683. DWORD fUseDatabase;
  1684. LPSTR pszDataFile;
  1685. // Masters
  1686. PIP_ARRAY aipMasters;
  1687. // Secondaries
  1688. DWORD fSecureSecondaries;
  1689. DWORD fNotifyLevel;
  1690. PIP_ARRAY aipSecondaries;
  1691. PIP_ARRAY aipNotify;
  1692. // WINS or Nbstat lookup
  1693. DWORD fUseWins;
  1694. DWORD fUseNbstat;
  1695. // Aging
  1696. DWORD fAging;
  1697. DWORD dwNoRefreshInterval;
  1698. DWORD dwRefreshInterval;
  1699. DWORD dwAvailForScavengeTime;
  1700. PIP_ARRAY aipScavengeServers;
  1701. // Below this point is new for Whistler
  1702. // Forwarder zones
  1703. DWORD dwForwarderTimeout;
  1704. DWORD fForwarderSlave;
  1705. // Stub zones
  1706. PIP_ARRAY aipLocalMasters;
  1707. // Directory partition
  1708. DWORD dwDpFlags;
  1709. LPSTR pszDpFqdn;
  1710. LPWSTR pwszZoneDn;
  1711. // Xfr time information
  1712. DWORD dwLastSuccessfulSoaCheck;
  1713. DWORD dwLastSuccessfulXfr;
  1714. // save some space, just in case
  1715. // DWORDS: save for SP enhancements
  1716. // POINTERS: BEFORE SHIP!!!
  1717. DWORD dwReserved1;
  1718. DWORD dwReserved2;
  1719. DWORD dwReserved3;
  1720. DWORD dwReserved4;
  1721. DWORD dwReserved5;
  1722. LPSTR pReserved1;
  1723. LPSTR pReserved2;
  1724. LPSTR pReserved3;
  1725. LPSTR pReserved4;
  1726. }
  1727. DNS_RPC_ZONE_INFO_WHISTLER, *PDNS_RPC_ZONE_INFO_WHISTLER;
  1728. typedef DNS_RPC_ZONE_INFO_WHISTLER DNS_ZONE_INFO, *PDNS_ZONE_INFO;
  1729. //
  1730. // Zone create data
  1731. //
  1732. typedef struct _DnsRpcZoneCreateInfo
  1733. {
  1734. LPSTR pszZoneName;
  1735. DWORD dwZoneType;
  1736. DWORD fAllowUpdate;
  1737. DWORD fAging;
  1738. DWORD dwFlags;
  1739. // Database info
  1740. LPSTR pszDataFile;
  1741. DWORD fDsIntegrated;
  1742. DWORD fLoadExisting;
  1743. // Admin name (if auto-create SOA)
  1744. LPSTR pszAdmin;
  1745. // Masters (if secondary)
  1746. PIP_ARRAY aipMasters;
  1747. // Secondaries
  1748. PIP_ARRAY aipSecondaries;
  1749. DWORD fSecureSecondaries;
  1750. DWORD fNotifyLevel;
  1751. // Reserve some space to avoid versioning issues
  1752. LPSTR pvReserved1;
  1753. LPSTR pvReserved2;
  1754. LPSTR pvReserved3;
  1755. LPSTR pvReserved4;
  1756. LPSTR pvReserved5;
  1757. LPSTR pvReserved6;
  1758. LPSTR pvReserved7;
  1759. LPSTR pvReserved8;
  1760. DWORD dwReserved1;
  1761. DWORD dwReserved2;
  1762. DWORD dwReserved3;
  1763. DWORD dwReserved4;
  1764. DWORD dwReserved5;
  1765. DWORD dwReserved6;
  1766. DWORD dwReserved7;
  1767. DWORD dwReserved8;
  1768. }
  1769. DNS_RPC_ZONE_CREATE_INFO_W2K, *PDNS_RPC_ZONE_CREATE_INFO_W2K;
  1770. typedef struct _DnsRpcZoneCreateInfoWhistler
  1771. {
  1772. DWORD dwRpcStuctureVersion;
  1773. DWORD dwReserved0;
  1774. LPSTR pszZoneName;
  1775. DWORD dwZoneType;
  1776. DWORD fAllowUpdate;
  1777. DWORD fAging;
  1778. DWORD dwFlags;
  1779. // Database info
  1780. LPSTR pszDataFile;
  1781. DWORD fDsIntegrated;
  1782. DWORD fLoadExisting;
  1783. // Admin name (if auto-create SOA)
  1784. LPSTR pszAdmin;
  1785. // Masters (if secondary)
  1786. PIP_ARRAY aipMasters;
  1787. // Secondaries
  1788. PIP_ARRAY aipSecondaries;
  1789. DWORD fSecureSecondaries;
  1790. DWORD fNotifyLevel;
  1791. // Below this point is new for Whistler.
  1792. // Forwarder zones
  1793. DWORD dwTimeout;
  1794. DWORD fSlave;
  1795. // Directory partition
  1796. DWORD dwDpFlags; // specify builtin DP or
  1797. LPSTR pszDpFqdn; // UTF8 FQDN of partition
  1798. // Reserve some space to avoid versioning issues - we have so much
  1799. // reserved because we don't want the Whistler structure to be smaller
  1800. // than the W2K structure on IA64.
  1801. DWORD dwReserved[ 32 ];
  1802. DWORD pReserved[ 32 ]; // remove before ship!
  1803. }
  1804. DNS_RPC_ZONE_CREATE_INFO_WHISTLER, *PDNS_RPC_ZONE_CREATE_INFO_WHISTLER;
  1805. //
  1806. // Zone Query API
  1807. //
  1808. DNS_STATUS
  1809. DNS_API_FUNCTION
  1810. DnssrvEnumZones(
  1811. IN LPCWSTR pwszServer,
  1812. IN DWORD dwFilter,
  1813. IN LPCSTR pszLastZone,
  1814. OUT PDNS_RPC_ZONE_LIST * ppZoneList
  1815. //OUT PDWORD pZoneCount,
  1816. //OUT PDNS_RPC_ZONE * ppZones
  1817. );
  1818. VOID
  1819. DNS_API_FUNCTION
  1820. DnssrvFreeZone(
  1821. IN OUT PDNS_RPC_ZONE pZone
  1822. );
  1823. VOID
  1824. DNS_API_FUNCTION
  1825. DnssrvFreeZoneList(
  1826. IN OUT PDNS_RPC_ZONE_LIST pZoneList
  1827. );
  1828. DNS_STATUS
  1829. DNS_API_FUNCTION
  1830. DnssrvQueryZoneDwordProperty(
  1831. IN LPCWSTR pwszServer,
  1832. IN LPCSTR pszZone,
  1833. IN LPCSTR pszProperty,
  1834. OUT PDWORD pdwResult
  1835. );
  1836. DNS_STATUS
  1837. DNS_API_FUNCTION
  1838. DnssrvGetZoneInfo(
  1839. IN LPCWSTR pwszServer,
  1840. IN LPCSTR pszZone,
  1841. OUT PDNS_RPC_ZONE_INFO * ppZoneInfo
  1842. );
  1843. VOID
  1844. DNS_API_FUNCTION
  1845. DnssrvFreeZoneInfo(
  1846. IN OUT PDNS_RPC_ZONE_INFO pZoneInfo
  1847. );
  1848. //
  1849. // Zone Operations API
  1850. //
  1851. #define DNS_ZONE_LOAD_OVERWRITE_MEMORY (0x00000010)
  1852. #define DNS_ZONE_LOAD_OVERWRITE_DS (0x00000020)
  1853. #define DNS_ZONE_LOAD_MERGE_EXISTING (0x00000040)
  1854. #define DNS_ZONE_LOAD_MUST_FIND (0x00000100)
  1855. #define DNS_ZONE_LOAD_EXISTING DNS_ZONE_LOAD_OVERWRITE_MEMORY
  1856. #define DNS_ZONE_OVERWRITE_EXISTING DNS_ZONE_LOAD_OVERWRITE_DS
  1857. #define DNS_ZONE_MERGE_WITH_EXISTING DNS_ZONE_LOAD_MERGE_EXISTING
  1858. //
  1859. // Zone create flags
  1860. //
  1861. #define DNS_ZONE_CREATE_FOR_DCPROMO (0x00001000)
  1862. #define DNS_ZONE_CREATE_AGING (0x00002000)
  1863. #if 0
  1864. // Currently these have direct parameter to CreateZone function
  1865. #define DNS_ZONE_CREATE_UPDATE (0x00010000)
  1866. #define DNS_ZONE_CREATE_UPDATE_SECURE (0x00020000)
  1867. #define DNS_ZONE_CREATE_DS_INTEGRATED (0x10000000)
  1868. #endif
  1869. DNS_STATUS
  1870. DNS_API_FUNCTION
  1871. DnssrvCreateZone(
  1872. IN LPCWSTR pwszServer,
  1873. IN LPCSTR pszZoneName,
  1874. IN DWORD dwZoneType,
  1875. IN LPCSTR pszAdminEmailName,
  1876. IN DWORD cMasters,
  1877. IN PIP_ADDRESS aipMasters,
  1878. IN DWORD fLoadExisting,
  1879. IN DWORD fDsIntegrated,
  1880. IN LPCSTR pszDataFile,
  1881. IN DWORD dwTimeout,
  1882. IN DWORD fSlave
  1883. );
  1884. DNS_STATUS
  1885. DNS_API_FUNCTION
  1886. DnssrvCreateZoneForDcPromo(
  1887. IN LPCWSTR Server,
  1888. IN LPCSTR pszZoneName,
  1889. IN LPCSTR pszDataFile
  1890. );
  1891. DNS_STATUS
  1892. DNS_API_FUNCTION
  1893. DnssrvCreateZoneInDirectoryPartition(
  1894. IN LPCWSTR pwszServer,
  1895. IN LPCSTR pszZoneName,
  1896. IN DWORD dwZoneType,
  1897. IN LPCSTR pszAdminEmailName,
  1898. IN DWORD cMasters,
  1899. IN PIP_ADDRESS aipMasters,
  1900. IN DWORD fLoadExisting,
  1901. IN DWORD dwTimeout,
  1902. IN DWORD fSlave,
  1903. IN DWORD dwDirPartFlags,
  1904. IN LPCSTR pszDirPartFqdn
  1905. );
  1906. DNS_STATUS
  1907. DNS_API_FUNCTION
  1908. DnssrvDelegateSubZone(
  1909. IN LPCWSTR pwszServer,
  1910. IN LPCSTR pszZoneName,
  1911. IN LPCSTR pszSubZone,
  1912. IN LPCSTR pszNewServer,
  1913. IN IP_ADDRESS ipNewServerAddr
  1914. );
  1915. DNS_STATUS
  1916. DNS_API_FUNCTION
  1917. DnssrvIncrementZoneVersion(
  1918. IN LPCWSTR pwszServer,
  1919. IN LPCSTR pszZoneName
  1920. );
  1921. DNS_STATUS
  1922. DNS_API_FUNCTION
  1923. DnssrvDeleteZone(
  1924. IN LPCWSTR pwszServer,
  1925. IN LPCSTR pszZoneName
  1926. );
  1927. DNS_STATUS
  1928. DNS_API_FUNCTION
  1929. DnssrvPauseZone(
  1930. IN LPCWSTR pwszServer,
  1931. IN LPCSTR pszZoneName
  1932. );
  1933. DNS_STATUS
  1934. DNS_API_FUNCTION
  1935. DnssrvResumeZone(
  1936. IN LPCWSTR pwszServer,
  1937. IN LPCSTR pszZoneName
  1938. );
  1939. DNS_STATUS
  1940. DNS_API_FUNCTION
  1941. DnssrvResetZoneType(
  1942. IN LPCWSTR pwszServer,
  1943. IN LPCSTR pszZoneName,
  1944. IN DWORD dwZoneType,
  1945. IN DWORD cMasters,
  1946. IN PIP_ADDRESS aipMasters
  1947. );
  1948. DNS_STATUS
  1949. DNS_API_FUNCTION
  1950. DnssrvResetZoneTypeEx(
  1951. IN LPCWSTR pwszServer,
  1952. IN LPCSTR pszZoneName,
  1953. IN DWORD dwZoneType,
  1954. IN DWORD cMasters,
  1955. IN PIP_ADDRESS aipMasters,
  1956. IN DWORD dwLoadOptions,
  1957. IN DWORD fDsIntegrated,
  1958. IN LPCSTR pszDataFile
  1959. );
  1960. DNS_STATUS
  1961. DNS_API_FUNCTION
  1962. DnssrvChangeZoneDirectoryPartition(
  1963. IN LPCWSTR pwszServer,
  1964. IN LPCSTR pszZoneName,
  1965. IN LPCSTR pszNewPartition
  1966. );
  1967. DNS_STATUS
  1968. DNS_API_FUNCTION
  1969. DnssrvResetZoneDatabase(
  1970. IN LPCWSTR pwszServer,
  1971. IN LPCSTR pszZoneName,
  1972. IN DWORD fUseDatabase,
  1973. IN LPCSTR pszDataFile
  1974. );
  1975. DNS_STATUS
  1976. DNS_API_FUNCTION
  1977. DnssrvResetZoneMasters(
  1978. IN LPCWSTR pwszServer,
  1979. IN LPCSTR pszZoneName,
  1980. IN DWORD cMasters,
  1981. IN PIP_ADDRESS aipMasters
  1982. );
  1983. DNS_STATUS
  1984. DNS_API_FUNCTION
  1985. DnssrvResetZoneMastersEx(
  1986. IN LPCWSTR pwszServer,
  1987. IN LPCSTR pszZoneName,
  1988. IN DWORD cMasters,
  1989. IN PIP_ADDRESS aipMasters,
  1990. IN DWORD fSetLocalMasters
  1991. );
  1992. DNS_STATUS
  1993. DNS_API_FUNCTION
  1994. DnssrvResetZoneSecondaries(
  1995. IN LPCWSTR Server,
  1996. IN LPCSTR pszZone,
  1997. IN DWORD fSecureSecondaries,
  1998. IN DWORD cSecondaries,
  1999. IN PIP_ADDRESS aipSecondaries,
  2000. IN DWORD fNotifyLevel,
  2001. IN DWORD cNotify,
  2002. IN PIP_ADDRESS aipNotify
  2003. );
  2004. DNS_STATUS
  2005. DNS_API_FUNCTION
  2006. DnssrvRenameZone(
  2007. IN LPCWSTR Server,
  2008. IN LPCSTR pszCurrentZoneName,
  2009. IN LPCSTR pszNewZoneName,
  2010. IN LPCSTR pszNewFileName
  2011. );
  2012. DNS_STATUS
  2013. DNS_API_FUNCTION
  2014. DnssrvExportZone(
  2015. IN LPCWSTR Server,
  2016. IN LPCSTR pszZoneName,
  2017. IN LPCSTR pszZoneExportFile
  2018. );
  2019. //
  2020. // Record \ Node viewing
  2021. //
  2022. //
  2023. // Counted string format used for both node name and strings
  2024. // in RPC buffer.
  2025. //
  2026. typedef struct _DnssrvRpcName
  2027. {
  2028. UCHAR cchNameLength;
  2029. CHAR achName[1]; // name of cchNameLength characters
  2030. }
  2031. DNS_RPC_NAME, *PDNS_RPC_NAME, DNS_RPC_STRING, *PDNS_RPC_STRING;
  2032. //
  2033. // Enumeration flags
  2034. //
  2035. #define DNS_RPC_FLAG_CACHE_DATA 0x80000000
  2036. #define DNS_RPC_FLAG_ZONE_ROOT 0x40000000
  2037. #define DNS_RPC_FLAG_AUTH_ZONE_ROOT 0x20000000
  2038. #define DNS_RPC_FLAG_ZONE_DELEGATION 0x10000000
  2039. // update record flags
  2040. #define DNS_RPC_FLAG_RECORD_DEFAULT_TTL 0x08000000
  2041. #define DNS_RPC_FLAG_RECORD_TTL_CHANGE 0x04000000
  2042. #define DNS_RPC_FLAG_RECORD_CREATE_PTR 0x02000000
  2043. #define DNS_RPC_FLAG_NODE_STICKY 0x01000000
  2044. #define DNS_RPC_FLAG_NODE_COMPLETE 0x00800000
  2045. #define DNS_RPC_FLAG_SUPPRESS_NOTIFY 0x00010000
  2046. // aging
  2047. #define DNS_RPC_FLAG_AGING_ON 0x00020000
  2048. #define DNS_RPC_FLAG_AGING_OFF 0x00040000
  2049. #define DNS_RPC_FLAG_OPEN_ACL 0x00080000
  2050. // bottom byte of flag reserved for rank
  2051. #define DNS_RPC_FLAG_RANK 0x000000ff
  2052. // naming backward compatibility
  2053. #define DNS_RPC_NODE_FLAG_STICKY DNS_RPC_FLAG_NODE_STICKY
  2054. #define DNS_RPC_NODE_FLAG_COMPLETE DNS_RPC_FLAG_NODE_COMPLETE
  2055. #define DNS_RPC_RECORD_FLAG_ZONE_ROOT DNS_RPC_FLAG_ZONE_ROOT
  2056. #define DNS_RPC_RECORD_FLAG_DEFAULT_TTL DNS_RPC_FLAG_RECORD_DEFAULT_TTL
  2057. #define DNS_RPC_RECORD_FLAG_TTL_CHANGE DNS_RPC_FLAG_RECORD_TTL_CHANGE
  2058. #define DNS_RPC_RECORD_FLAG_CREATE_PTR DNS_RPC_FLAG_RECORD_CREATE_PTR
  2059. #define DNS_RPC_RECORD_FLAG_CACHE_DATA DNS_RPC_FLAG_CACHE_DATA
  2060. #define DNS_RPC_RECORD_FLAG_AUTH_ZONE_ROOT DNS_RPC_FLAG_AUTH_ZONE_ROOT
  2061. #define DNS_RPC_RECORD_FLAG_ZONE_ROOT DNS_RPC_FLAG_ZONE_ROOT
  2062. // DCR_CLEANUP: remove backward compatibility flag
  2063. #define DNS_RPC_RECORD_FLAG_AGING_ON DNS_RPC_FLAG_AGING_ON
  2064. //
  2065. // DNS node structure for on the wire
  2066. //
  2067. typedef struct _DnssrvRpcNode
  2068. {
  2069. WORD wLength;
  2070. WORD wRecordCount;
  2071. DWORD dwFlags;
  2072. DWORD dwChildCount;
  2073. DNS_RPC_NAME dnsNodeName;
  2074. }
  2075. DNS_RPC_NODE, *PDNS_RPC_NODE;
  2076. #define SIZEOF_DNS_RPC_NODE_HEADER (3*sizeof(DWORD))
  2077. //
  2078. // Resource record structure for passing records on the wire
  2079. //
  2080. // For efficiency, all these fields are aligned.
  2081. // When buffered for transmission, all RR should start on DWORD
  2082. // aligned boundary.
  2083. //
  2084. // Below we use NULL type to force default size of DNS_RPC_RECORD to
  2085. // largest possible size of non-TXT record -- currently SOA: two DNS names
  2086. // and 20 bytes. This is convenient for throwing these records on the stack
  2087. // when doing simple creates.
  2088. #define DNS_RPC_DEFAULT_RECORD_DATA_LENGTH (2*DNS_MAX_NAME_LENGTH+20)
  2089. typedef union _DnsRpcRecordData
  2090. {
  2091. struct
  2092. {
  2093. IP_ADDRESS ipAddress;
  2094. }
  2095. A;
  2096. struct
  2097. {
  2098. DWORD dwSerialNo;
  2099. DWORD dwRefresh;
  2100. DWORD dwRetry;
  2101. DWORD dwExpire;
  2102. DWORD dwMinimumTtl;
  2103. DNS_RPC_NAME namePrimaryServer;
  2104. // responsible party follows in buffer
  2105. }
  2106. SOA, Soa;
  2107. struct
  2108. {
  2109. DNS_RPC_NAME nameNode;
  2110. }
  2111. PTR, Ptr,
  2112. NS, Ns,
  2113. CNAME, Cname,
  2114. MB, Mb,
  2115. MD, Md,
  2116. MF, Mf,
  2117. MG, Mg,
  2118. MR, Mr;
  2119. struct
  2120. {
  2121. DNS_RPC_NAME nameMailBox;
  2122. // errors to mailbox follows in buffer
  2123. }
  2124. MINFO, Minfo,
  2125. RP, Rp;
  2126. struct
  2127. {
  2128. WORD wPreference;
  2129. DNS_RPC_NAME nameExchange;
  2130. }
  2131. MX, Mx,
  2132. AFSDB, Afsdb,
  2133. RT, Rt;
  2134. struct
  2135. {
  2136. DNS_RPC_STRING stringData;
  2137. // one or more strings may follow
  2138. }
  2139. HINFO, Hinfo,
  2140. ISDN, Isdn,
  2141. TXT, Txt,
  2142. X25;
  2143. struct
  2144. {
  2145. BYTE bData[ DNS_RPC_DEFAULT_RECORD_DATA_LENGTH ];
  2146. }
  2147. Null;
  2148. struct
  2149. {
  2150. IP_ADDRESS ipAddress;
  2151. UCHAR chProtocol;
  2152. BYTE bBitMask[1];
  2153. }
  2154. WKS, Wks;
  2155. struct
  2156. {
  2157. IP6_ADDRESS ipv6Address;
  2158. }
  2159. AAAA;
  2160. struct
  2161. {
  2162. WORD wPriority;
  2163. WORD wWeight;
  2164. WORD wPort;
  2165. DNS_RPC_NAME nameTarget;
  2166. }
  2167. SRV, Srv;
  2168. struct
  2169. {
  2170. UCHAR chFormat;
  2171. BYTE bAddress[1];
  2172. }
  2173. ATMA;
  2174. //
  2175. // DNSSEC types
  2176. //
  2177. struct
  2178. {
  2179. WORD wFlags;
  2180. BYTE chProtocol;
  2181. BYTE chAlgorithm;
  2182. BYTE bKey[1];
  2183. }
  2184. KEY, Key;
  2185. struct
  2186. {
  2187. WORD wTypeCovered;
  2188. BYTE chAlgorithm;
  2189. BYTE chLabelCount;
  2190. DWORD dwOriginalTtl;
  2191. DWORD dwSigExpiration;
  2192. DWORD dwSigInception;
  2193. WORD wKeyTag;
  2194. DNS_RPC_STRING nameSigner;
  2195. // binary signature data follows
  2196. }
  2197. SIG, Sig;
  2198. struct
  2199. {
  2200. WORD wNumTypeWords; // always at least 1
  2201. WORD wTypeWords[ 1 ];
  2202. // following the array of WORDs is the DNS_RPC_STRING for the next name
  2203. }
  2204. NXT, Nxt;
  2205. //
  2206. // MS types
  2207. //
  2208. struct
  2209. {
  2210. DWORD dwMappingFlag;
  2211. DWORD dwLookupTimeout;
  2212. DWORD dwCacheTimeout;
  2213. DWORD cWinsServerCount;
  2214. IP_ADDRESS aipWinsServers[1]; // array of cWinsServerCount IP
  2215. }
  2216. WINS, Wins;
  2217. struct
  2218. {
  2219. DWORD dwMappingFlag;
  2220. DWORD dwLookupTimeout;
  2221. DWORD dwCacheTimeout;
  2222. DNS_RPC_NAME nameResultDomain;
  2223. }
  2224. WINSR, WinsR, NBSTAT, Nbstat;
  2225. struct
  2226. {
  2227. LONGLONG EntombedTime;
  2228. }
  2229. Tombstone;
  2230. }
  2231. DNS_RPC_RECORD_DATA, *PDNS_RPC_RECORD_DATA,
  2232. DNS_FLAT_RECORD_DATA, *PDNS_FLAT_RECORD_DATA;
  2233. //
  2234. // RPC record structure
  2235. //
  2236. typedef struct _DnssrvRpcRecord
  2237. {
  2238. WORD wDataLength;
  2239. WORD wType;
  2240. DWORD dwFlags;
  2241. DWORD dwSerial;
  2242. DWORD dwTtlSeconds;
  2243. DWORD dwTimeStamp;
  2244. DWORD dwReserved;
  2245. #ifdef MIDL_PASS
  2246. [size_is(wDataLength)] BYTE Buffer[];
  2247. #else
  2248. DNS_FLAT_RECORD_DATA Data;
  2249. #endif
  2250. }
  2251. DNS_RPC_RECORD, *PDNS_RPC_RECORD,
  2252. DNS_FLAT_RECORD, *PDNS_FLAT_RECORD;
  2253. #define SIZEOF_DNS_RPC_RECORD_HEADER (6*sizeof(DWORD))
  2254. #define SIZEOF_FLAT_RECORD_HEADER (SIZEOF_DNS_RPC_RECORD_HEADER)
  2255. #define SIZEOF_DNS_RPC_RECORD_FIXED_FIELD2 \
  2256. (sizeof(DNS_RPC_RECORD) - sizeof(struct _DnssrvRpcRecord.Data))
  2257. // Max record is header + 64K of data
  2258. #define DNS_MAX_FLAT_RECORD_BUFFER_LENGTH \
  2259. (0x10004 + SIZEOF_DNS_RPC_RECORD_HEADER)
  2260. //
  2261. // WINS + NBSTAT params
  2262. // - default lookup timeout
  2263. // - default cache timeout
  2264. //
  2265. #define DNS_WINS_DEFAULT_LOOKUP_TIMEOUT (5) // 5 secs
  2266. #define DNS_WINS_DEFAULT_CACHE_TIMEOUT (600) // 10 minutes
  2267. //
  2268. // Note, for simplicity/efficiency ALL structures are DWORD aligned in
  2269. // buffers on the wire.
  2270. //
  2271. // This macro returns DWORD aligned ptr at given ptr our next DWORD
  2272. // aligned postion. Set ptr immediately after record or name structure
  2273. // and this will return starting position of next structure.
  2274. //
  2275. // Be careful that you do not DWORD align anything that contains a
  2276. // pointer - you must use DNS_NEXT_ALIGNED_PTR for that so that we
  2277. // don't cause alignment faults on ia64.
  2278. //
  2279. #define DNS_NEXT_DWORD_PTR(ptr) ((PBYTE) ((DWORD_PTR)((PBYTE)ptr + 3) & ~(DWORD_PTR)3))
  2280. #define DNS_NEXT_DDWORD_PTR(ptr) ((PBYTE) ((DWORD_PTR)((PBYTE)ptr + 7) & ~(DWORD_PTR)7))
  2281. #ifdef IA64
  2282. #define DNS_NEXT_ALIGNED_PTR(p) DNS_NEXT_DDWORD_PTR(p)
  2283. #else
  2284. #define DNS_NEXT_ALIGNED_PTR(p) DNS_NEXT_DWORD_PTR(p)
  2285. #endif
  2286. #define DNS_IS_DWORD_ALIGNED(p) ( !((DWORD_PTR)(p) & (DWORD_PTR)3) )
  2287. //
  2288. // Helpful record macros
  2289. // - no side effects in arguments
  2290. //
  2291. #define DNS_GET_NEXT_NAME(pname) \
  2292. (PDNS_RPC_NAME) ((pname)->achName + (pname)->cchNameLength)
  2293. #define DNS_IS_NAME_IN_RECORD(pRecord, pname) \
  2294. ( DNS_GET_END_OF_RPC_RECORD_DATA(pRecord) >= \
  2295. (PCHAR)DNS_GET_NEXT_NAME(pname) )
  2296. #define DNS_GET_END_OF_RPC_RECORD_DATA(pRecord) \
  2297. ( (PCHAR)&(pRecord)->Data + (pRecord)->wDataLength )
  2298. #define DNS_IS_RPC_RECORD_WITHIN_BUFFER( pRecord, pStopByte ) \
  2299. ( (PCHAR)&(pRecord)->Data <= (pStopByte) && \
  2300. DNS_GET_END_OF_RPC_RECORD_DATA(pRecord) <= (pStopByte) )
  2301. #define DNS_GET_NEXT_RPC_RECORD(pRecord) \
  2302. ( (PDNS_RPC_RECORD) \
  2303. DNS_NEXT_DWORD_PTR( DNS_GET_END_OF_RPC_RECORD_DATA(pRecord) ) )
  2304. //
  2305. // These RPC structures have no version because they are simple
  2306. // are they are explicitly defined by their names.
  2307. //
  2308. typedef struct _DnssrvRpcNameAndParam
  2309. {
  2310. DWORD dwParam;
  2311. LPSTR pszNodeName;
  2312. }
  2313. DNS_RPC_NAME_AND_PARAM, *PDNS_RPC_NAME_AND_PARAM;
  2314. typedef struct _DnssrvRpcNameAndString
  2315. {
  2316. LPWSTR pwszParam;
  2317. LPSTR pszNodeName;
  2318. DWORD dwFlags;
  2319. }
  2320. DNS_RPC_NAME_AND_STRING, *PDNS_RPC_NAME_AND_STRING;
  2321. typedef struct _DnssrvRpcNameAndIPList
  2322. {
  2323. PIP_ARRAY aipList;
  2324. LPSTR pszNodeName;
  2325. DWORD dwFlags;
  2326. }
  2327. DNS_RPC_NAME_AND_IPLIST, *PDNS_RPC_NAME_AND_IPLIST;
  2328. //
  2329. // Record viewing API
  2330. //
  2331. #define DNS_RPC_VIEW_AUTHORITY_DATA 0x00000001
  2332. #define DNS_RPC_VIEW_CACHE_DATA 0x00000002
  2333. #define DNS_RPC_VIEW_GLUE_DATA 0x00000004
  2334. #define DNS_RPC_VIEW_ROOT_HINT_DATA 0x00000008
  2335. #define DNS_RPC_VIEW_ALL_DATA 0x0000000f
  2336. #define DNS_RPC_VIEW_ADDITIONAL_DATA 0x00000010
  2337. #define DNS_RPC_VIEW_NO_CHILDREN 0x00010000
  2338. #define DNS_RPC_VIEW_ONLY_CHILDREN 0x00020000
  2339. #define DNS_RPC_VIEW_CHILDREN_MASK 0x000f0000
  2340. DNS_STATUS
  2341. DNS_API_FUNCTION
  2342. DnssrvEnumRecordsEx(
  2343. IN DWORD dwClientVersion,
  2344. IN DWORD dwSettingFlags,
  2345. IN LPCWSTR Server,
  2346. IN LPCSTR pszZoneName,
  2347. IN LPCSTR pszNodeName,
  2348. IN LPCSTR pszStartChild,
  2349. IN WORD wRecordType,
  2350. IN DWORD dwSelectFlag,
  2351. IN LPCSTR pszFilterStart,
  2352. IN LPCSTR pszFilterStop,
  2353. IN OUT PDWORD pdwBufferLength,
  2354. OUT PBYTE * ppBuffer
  2355. );
  2356. #define DnssrvEnumRecords( s, z, n, sc, typ, sf, fstart, fstop, blen, p ) \
  2357. DnssrvEnumRecordsEx( DNS_RPC_CURRENT_CLIENT_VER, \
  2358. 0, (s), (z), (n), (sc), (typ), \
  2359. (sf), (fstart), (fstop), (blen), (p) )
  2360. #define DnssrvFreeRecordsBuffer( pBuf ) \
  2361. DnssrvFreeRpcBuffer( (PDNS_RPC_BUFFER)pBuf )
  2362. PCHAR
  2363. DnssrvGetWksServicesInRecord(
  2364. IN PDNS_FLAT_RECORD pRR
  2365. );
  2366. //
  2367. // Record management API
  2368. //
  2369. DNS_STATUS
  2370. DNS_API_FUNCTION
  2371. DnssrvUpdateRecordEx(
  2372. IN DWORD dwClientVersion,
  2373. IN DWORD dwSettingFlags,
  2374. IN LPCWSTR pwszServer,
  2375. IN LPCSTR pszZoneName,
  2376. IN LPCSTR pszNodeName,
  2377. IN PDNS_RPC_RECORD pAddRecord,
  2378. IN PDNS_RPC_RECORD pDeleteRecord
  2379. );
  2380. #define DnssrvUpdateRecord( s, z, n, add, del ) \
  2381. DnssrvUpdateRecordEx( DNS_RPC_CURRENT_CLIENT_VER, \
  2382. 0, (s), (z), (n), (add), (del) )
  2383. DNS_STATUS
  2384. DNS_API_FUNCTION
  2385. DnssrvDeleteNode(
  2386. IN LPCWSTR pwszServer,
  2387. IN LPCSTR pszZoneName,
  2388. IN LPCSTR pszNodeName,
  2389. IN BOOL bDeleteSubtree
  2390. );
  2391. DNS_STATUS
  2392. DNS_API_FUNCTION
  2393. DnssrvDeleteRecordSet(
  2394. IN LPCWSTR pwszServer,
  2395. IN LPCSTR pszZoneName,
  2396. IN LPCSTR pszNodeName,
  2397. IN WORD wType
  2398. );
  2399. DNS_STATUS
  2400. DNS_API_FUNCTION
  2401. DnssrvForceAging(
  2402. IN LPCWSTR pwszServer,
  2403. IN LPCSTR pszZoneName,
  2404. IN LPCSTR pszNodeName,
  2405. IN BOOL fAgeSubtree
  2406. );
  2407. //
  2408. // Programmable record management API -- for Small Business Server (SBS)
  2409. //
  2410. VOID
  2411. DNS_API_FUNCTION
  2412. DnssrvFillRecordHeader(
  2413. IN OUT PDNS_RPC_RECORD pRecord,
  2414. IN DWORD dwTtl,
  2415. IN DWORD dwTimeout,
  2416. IN BOOL fSuppressNotify
  2417. );
  2418. DWORD
  2419. DNS_API_FUNCTION
  2420. DnssrvWriteNameToFlatBuffer(
  2421. IN OUT PCHAR pchWrite,
  2422. IN LPCSTR pszName
  2423. );
  2424. DNS_STATUS
  2425. DNS_API_FUNCTION
  2426. DnssrvFillOutSingleIndirectionRecord(
  2427. IN OUT PDNS_RPC_RECORD pRecord,
  2428. IN WORD wType,
  2429. IN LPCSTR pszName
  2430. );
  2431. DNS_STATUS
  2432. DNS_API_FUNCTION
  2433. DnssrvAddARecord(
  2434. IN LPCWSTR pwszServer,
  2435. IN LPCSTR pszNodeName,
  2436. IN IP_ADDRESS ipAddress,
  2437. IN DWORD dwTtl,
  2438. IN DWORD dwTimeout,
  2439. IN BOOL fSuppressNotify
  2440. );
  2441. DNS_STATUS
  2442. DNS_API_FUNCTION
  2443. DnssrvAddCnameRecord(
  2444. IN LPCWSTR pwszServer,
  2445. IN LPCSTR pszNodeName,
  2446. IN LPCSTR pszCannonicalName,
  2447. IN DWORD dwTtl,
  2448. IN DWORD dwTimeout,
  2449. IN BOOL fSuppressNotify
  2450. );
  2451. DNS_STATUS
  2452. DNS_API_FUNCTION
  2453. DnssrvAddMxRecord(
  2454. IN LPCWSTR pwszServer,
  2455. IN LPCSTR pszNodeName,
  2456. IN LPCSTR pszMailExchangeHost,
  2457. IN WORD wPreference,
  2458. IN DWORD dwTtl,
  2459. IN DWORD dwTimeout,
  2460. IN BOOL fSuppressNotify
  2461. );
  2462. DNS_STATUS
  2463. DNS_API_FUNCTION
  2464. DnssrvAddNsRecord(
  2465. IN LPCWSTR pwszServer,
  2466. IN LPCSTR pszNodeName,
  2467. IN LPCSTR pszNsHostName,
  2468. IN DWORD dwTtl,
  2469. IN DWORD dwTimeout,
  2470. IN BOOL fSuppressNotify
  2471. );
  2472. DNS_STATUS
  2473. DNS_API_FUNCTION
  2474. DnssrvConcatDnsNames(
  2475. OUT PCHAR pszResult,
  2476. IN LPCSTR pszDomain,
  2477. IN LPCSTR pszName
  2478. );
  2479. DNS_STATUS
  2480. DNS_API_FUNCTION
  2481. DnssrvDeleteARecord(
  2482. IN LPCWSTR pwszServer,
  2483. IN LPCSTR pszName,
  2484. IN IP_ADDRESS ipHost,
  2485. IN BOOL fSuppressNotify
  2486. );
  2487. DNS_STATUS
  2488. DNS_API_FUNCTION
  2489. DnssrvDeleteCnameRecord(
  2490. IN LPCWSTR pwszServer,
  2491. IN LPCSTR pszNodeName,
  2492. IN LPCSTR pszCannonicalName,
  2493. IN BOOL fSuppressNotify
  2494. );
  2495. DNS_STATUS
  2496. DNS_API_FUNCTION
  2497. DnssrvDeleteMxRecord(
  2498. IN LPCWSTR pwszServer,
  2499. IN LPCSTR pszNodeName,
  2500. IN LPCSTR pszMailExchangeHost,
  2501. IN WORD wPreference,
  2502. IN BOOL fSuppressNotify
  2503. );
  2504. DNS_STATUS
  2505. DNS_API_FUNCTION
  2506. DnssrvDeleteNsRecord(
  2507. IN LPCWSTR pwszServer,
  2508. IN LPCSTR pszNodeName,
  2509. IN LPCSTR pszNsHostName,
  2510. IN BOOL fSuppressNotify
  2511. );
  2512. DNS_STATUS
  2513. DNS_API_FUNCTION
  2514. DnssrvSbsAddClientToIspZone(
  2515. IN LPCWSTR pwszServer,
  2516. IN LPCSTR pszIspZone,
  2517. IN LPCSTR pszClient,
  2518. IN LPCSTR pszClientHost,
  2519. IN IP_ADDRESS ipClientHost,
  2520. IN DWORD dwTtl
  2521. );
  2522. DNS_STATUS
  2523. DNS_API_FUNCTION
  2524. DnssrvSbsDeleteRecord(
  2525. IN LPCWSTR pwszServer,
  2526. IN LPCSTR pszZone,
  2527. IN LPCSTR pszDomain,
  2528. IN LPCSTR pszName,
  2529. IN WORD wType,
  2530. IN LPCSTR pszDataName,
  2531. IN IP_ADDRESS ipHost
  2532. );
  2533. //
  2534. // DNS_RECORD compatible record API
  2535. //
  2536. //
  2537. // No MIDL for DNS_NODE type (to avoid bringing in dnsapi.h)
  2538. // or for local print routines
  2539. //
  2540. #ifndef MIDL_PASS
  2541. //
  2542. // Node structure for Admin side
  2543. //
  2544. #include <dnsapi.h>
  2545. typedef struct _DnssrvNodeFlags
  2546. {
  2547. BYTE Domain : 1;
  2548. BYTE ZoneRoot : 1;
  2549. BYTE Unused : 5;
  2550. BYTE Unused2 : 5;
  2551. BYTE FreeOwner : 1;
  2552. BYTE Unicode : 1;
  2553. BYTE Utf8 : 1;
  2554. WORD Reserved;
  2555. }
  2556. DNSNODE_FLAGS;
  2557. typedef struct _DnssrvNode
  2558. {
  2559. struct _DnssrvNode * pNext;
  2560. PWSTR pName;
  2561. PDNS_RECORD pRecord;
  2562. union
  2563. {
  2564. DWORD W; // flags as dword
  2565. DNSNODE_FLAGS S; // flags as structure
  2566. } Flags;
  2567. }
  2568. DNS_NODE, *PDNS_NODE;
  2569. //
  2570. // Record "section" flags
  2571. //
  2572. // Overload DNS_RECORD.Flag section fields with RPC data type info
  2573. //
  2574. #define DNSREC_CACHE_DATA (0x00000000)
  2575. #define DNSREC_ZONE_DATA (0x00000001)
  2576. #define DNSREC_GLUE_DATA (0x00000002)
  2577. #define DNSREC_ROOT_HINT (0x00000003)
  2578. DNS_STATUS
  2579. DNS_API_FUNCTION
  2580. DnssrvEnumRecordsAndConvertNodes(
  2581. IN LPCWSTR pwszServer,
  2582. IN LPCSTR pszZoneName,
  2583. IN LPCSTR pszNodeName,
  2584. IN LPCSTR pszStartChild,
  2585. IN WORD wRecordType,
  2586. IN DWORD dwSelectFlag,
  2587. IN LPCSTR pszFilterStart,
  2588. IN LPCSTR pszFilterStop,
  2589. OUT PDNS_NODE * ppNodeFirst,
  2590. OUT PDNS_NODE * ppNodeLast
  2591. );
  2592. VOID
  2593. DNS_API_FUNCTION
  2594. DnssrvFreeNode(
  2595. IN OUT PDNS_NODE pNode,
  2596. IN BOOLEAN fFreeRecords
  2597. );
  2598. VOID
  2599. DNS_API_FUNCTION
  2600. DnssrvFreeNodeList(
  2601. IN OUT PDNS_NODE pNode,
  2602. IN BOOLEAN fFreeRecords
  2603. );
  2604. #endif // not MIDL_PASS
  2605. //
  2606. // Directory partition APIs
  2607. //
  2608. DNS_STATUS
  2609. DNS_API_FUNCTION
  2610. DnssrvSetupDefaultDirectoryPartitions(
  2611. IN LPCWSTR Server,
  2612. IN DWORD dwOperation
  2613. );
  2614. DNS_STATUS
  2615. DNS_API_FUNCTION
  2616. DnssrvEnumDirectoryPartitions(
  2617. IN LPCWSTR Server,
  2618. IN DWORD dwFilter,
  2619. OUT PDNS_RPC_DP_LIST * ppDpList
  2620. );
  2621. DNS_STATUS
  2622. DNS_API_FUNCTION
  2623. DnssrvDirectoryPartitionInfo(
  2624. IN LPCWSTR Server,
  2625. IN LPSTR pDpFqdn,
  2626. OUT PDNS_RPC_DP_INFO * ppDpInfo
  2627. );
  2628. DNS_STATUS
  2629. DNS_API_FUNCTION
  2630. DnssrvGetDpInfo(
  2631. IN LPCWSTR pwszServer,
  2632. IN LPCSTR pszDp,
  2633. OUT PDNS_RPC_DP_INFO * ppDpInfo
  2634. );
  2635. VOID
  2636. DNS_API_FUNCTION
  2637. DnssrvFreeDirectoryPartitionEnum(
  2638. IN OUT PDNS_RPC_DP_ENUM pDp
  2639. );
  2640. VOID
  2641. DNS_API_FUNCTION
  2642. DnssrvFreeDirectoryPartitionInfo(
  2643. IN OUT PDNS_RPC_DP_INFO pDp
  2644. );
  2645. VOID
  2646. DNS_API_FUNCTION
  2647. DnssrvFreeDirectoryPartitionList(
  2648. IN OUT PDNS_RPC_DP_LIST pDpList
  2649. );
  2650. DNS_STATUS
  2651. DNS_API_FUNCTION
  2652. DnssrvEnlistDirectoryPartition(
  2653. IN LPCWSTR pszServer,
  2654. IN DWORD dwOperation,
  2655. IN LPCSTR pszDirPartFqdn
  2656. );
  2657. //
  2658. // NT5+ General API
  2659. //
  2660. // For NT5+ there is a very small set of actually remoteable API,
  2661. // which are highly extensible. The basic approach is to have
  2662. // query and operation functions which can handle many different
  2663. // operations by taking the operation and type as parameters.
  2664. //
  2665. //
  2666. // DNS Server Properties
  2667. //
  2668. // Properties may be queried.
  2669. // Properties may and new data may be sent in as operation to
  2670. // reset property.
  2671. //
  2672. #define DNS_REGKEY_BOOT_REGISTRY "EnableRegistryBoot"
  2673. #define DNS_REGKEY_BOOT_METHOD "BootMethod"
  2674. #define DNS_REGKEY_ADMIN_CONFIGURED "AdminConfigured"
  2675. #define DNS_REGKEY_BOOT_FILENAME "BootFile"
  2676. #define DNS_REGKEY_ROOT_HINTS_FILE "RootHintsFile"
  2677. #define DNS_REGKEY_DATABASE_DIRECTORY "DatabaseDirectory"
  2678. #define DNS_REGKEY_RPC_PROTOCOL "RpcProtocol"
  2679. #define DNS_REGKEY_LOG_LEVEL "LogLevel"
  2680. #define DNS_REGKEY_LOG_FILE_MAX_SIZE "LogFileMaxSize"
  2681. #define DNS_REGKEY_LOG_FILE_PATH "LogFilePath"
  2682. #define DNS_REGKEY_LOG_IP_FILTER_LIST "LogIPFilterList"
  2683. #define DNS_REGKEY_EVENTLOG_LEVEL "EventLogLevel"
  2684. #define DNS_REGKEY_USE_SYSTEM_EVENTLOG "UseSystemEventLog"
  2685. #define DNS_REGKEY_DEBUG_LEVEL "DebugLevel"
  2686. #define DNS_REGKEY_LISTEN_ADDRESSES "ListenAddresses"
  2687. #define DNS_REGKEY_PUBLISH_ADDRESSES "PublishAddresses"
  2688. #define DNS_REGKEY_DISJOINT_NETS "DisjointNets"
  2689. #define DNS_REGKEY_SEND_PORT "SendPort"
  2690. #define DNS_REGKEY_NO_TCP "NoTcp"
  2691. #define DNS_REGKEY_XFR_CONNECT_TIMEOUT "XfrConnectTimeout"
  2692. #define DNS_REGKEY_NO_RECURSION "NoRecursion"
  2693. #define DNS_REGKEY_RECURSE_SINGLE_LABEL "RecurseSingleLabel"
  2694. #define DNS_REGKEY_MAX_CACHE_TTL "MaxCacheTtl"
  2695. #define DNS_REGKEY_MAX_NEGATIVE_CACHE_TTL "MaxNegativeCacheTtl"
  2696. #define DNS_REGKEY_SECURE_RESPONSES "SecureResponses"
  2697. #define DNS_REGKEY_RECURSION_RETRY "RecursionRetry"
  2698. #define DNS_REGKEY_RECURSION_TIMEOUT "RecursionTimeout"
  2699. #define DNS_REGKEY_ADDITIONAL_RECURSION_TIMEOUT "AdditionalRecursionTimeout"
  2700. #define DNS_REGKEY_FORWARDERS "Forwarders"
  2701. #define DNS_REGKEY_FORWARD_TIMEOUT "ForwardingTimeout"
  2702. #define DNS_REGKEY_SLAVE "IsSlave"
  2703. #define DNS_REGKEY_FORWARD_DELEGATIONS "ForwardDelegations"
  2704. #define DNS_REGKEY_INET_RECURSE_TO_ROOT_MASK "RecurseToInternetRootMask"
  2705. #define DNS_REGKEY_AUTO_CREATE_DELEGATIONS "AutoCreateDelegations"
  2706. #define DNS_REGKEY_NO_AUTO_REVERSE_ZONES "DisableAutoReverseZones"
  2707. #define DNS_REGKEY_DS_POLLING_INTERVAL "DsPollingInterval"
  2708. #define DNS_REGKEY_DS_TOMBSTONE_INTERVAL "DsTombstoneInterval"
  2709. #define DNS_REGKEY_AUTO_CACHE_UPDATE "AutoCacheUpdate"
  2710. #define DNS_REGKEY_ALLOW_UPDATE "AllowUpdate"
  2711. #define DNS_REGKEY_UPDATE_OPTIONS "UpdateOptions"
  2712. #define DNS_REGKEY_NO_UPDATE_DELEGATIONS "NoUpdateDelegations"
  2713. #define DNS_REGKEY_AUTO_CONFIG_FILE_ZONES "AutoConfigFileZones"
  2714. #define DNS_REGKEY_SCAVENGING_INTERVAL "ScavengingInterval"
  2715. #define DNS_REGKEY_SCAVENGING_STATE "ScavengingState"
  2716. #define DNS_REGKEY_NAME_CHECK_FLAG "NameCheckFlag"
  2717. #define DNS_REGKEY_ROUND_ROBIN "RoundRobin"
  2718. #define DNS_REGKEY_NO_ROUND_ROBIN "DoNotRoundRobinTypes"
  2719. #define DNS_REGKEY_LOCAL_NET_PRIORITY "LocalNetPriority"
  2720. #define DNS_REGKEY_LOCAL_NET_PRIORITY_NETMASK "LocalNetPriorityNetMask"
  2721. #define DNS_REGKEY_ADDRESS_ANSWER_LIMIT "AddressAnswerLimit"
  2722. #define DNS_REGKEY_BIND_SECONDARIES "BindSecondaries"
  2723. #define DNS_REGKEY_WRITE_AUTHORITY_SOA "WriteAuthoritySoa"
  2724. #define DNS_REGKEY_WRITE_AUTHORITY_NS "WriteAuthorityNs"
  2725. #define DNS_REGKEY_STRICT_FILE_PARSING "StrictFileParsing"
  2726. #define DNS_REGKEY_DELETE_OUTSIDE_GLUE "DeleteOutsideGlue"
  2727. #define DNS_REGKEY_LOOSE_WILDCARDING "LooseWildcarding"
  2728. #define DNS_REGKEY_WILDCARD_ALL_TYPES "WildcardAllTypes"
  2729. #define DNS_REGKEY_APPEND_MS_XFR_TAG "AppendMsZoneTransferTag"
  2730. #define DNS_REGKEY_DEFAULT_AGING_STATE "DefaultAgingState"
  2731. #define DNS_REGKEY_DEFAULT_REFRESH_INTERVAL "DefaultRefreshInterval"
  2732. #define DNS_REGKEY_DEFAULT_NOREFRESH_INTERVAL "DefaultNoRefreshInterval"
  2733. #define DNS_REGKEY_MAX_CACHE_SIZE "MaxCacheSize" // in kilobytes
  2734. #define DNS_REGKEY_ENABLE_EDNS "EnableEDnsProbes"
  2735. #define DNS_REGKEY_MAX_UDP_PACKET_SIZE "MaximumUdpPacketSize"
  2736. #define DNS_REGKEY_EDNS_CACHE_TIMEOUT "EDnsCacheTimeout"
  2737. #define DNS_REGKEY_ENABLE_DNSSEC "EnableDnsSec"
  2738. #define DNS_REGKEY_ENABLE_SENDERR_SUPPRESSION "EnableSendErrorSuppression"
  2739. // Diretory partitions
  2740. #define DNS_REGKEY_ENABLE_DP "EnableDirectoryPartitions"
  2741. #define DNS_REGKEY_FOREST_DP_BASE_NAME "ForestDirectoryPartitionBaseName"
  2742. #define DNS_REGKEY_DOMAIN_DP_BASE_NAME "DomainDirectoryPartitionBaseName"
  2743. #define DNS_REGKEY_DISABLE_AUTONS "DisableNSRecordsAutoCreation" // 0/1 flag
  2744. #define DNS_REGKEY_SILENT_IGNORE_CNAME_UPDATE_CONFLICT "SilentlyIgnoreCNameUpdateConflicts"
  2745. // Zone properties
  2746. #define DNS_REGKEY_ZONE_TYPE "Type"
  2747. #define DNS_REGKEY_ZONE_FILE "DatabaseFile"
  2748. #define DNS_REGKEY_ZONE_MASTERS "MasterServers"
  2749. #define DNS_REGKEY_ZONE_LOCAL_MASTERS "LocalMasterServers"
  2750. #define DNS_REGKEY_ZONE_SECURE_SECONDARIES "SecureSecondaries"
  2751. #define DNS_REGKEY_ZONE_NOTIFY_LEVEL "NotifyLevel"
  2752. #define DNS_REGKEY_ZONE_SECONDARIES "SecondaryServers"
  2753. #define DNS_REGKEY_ZONE_NOTIFY_LIST "NotifyServers"
  2754. #define DNS_REGKEY_ZONE_ALLOW_UPDATE "AllowUpdate"
  2755. #define DNS_REGKEY_ZONE_DS_INTEGRATED "DsIntegrated"
  2756. #define DNS_REGKEY_ZONE_LOG_UPDATES "LogUpdates"
  2757. #define DNS_REGKEY_ZONE_FWD_TIMEOUT "ForwarderTimeout"
  2758. #define DNS_REGKEY_ZONE_FWD_SLAVE "ForwarderSlave"
  2759. #define DNS_REGKEY_ZONE_AGING "Aging"
  2760. #define DNS_REGKEY_ZONE_NOREFRESH_INTERVAL "NoRefreshInterval"
  2761. #define DNS_REGKEY_ZONE_REFRESH_INTERVAL "RefreshInterval"
  2762. #define DNS_REGKEY_ZONE_SCAVENGE_SERVERS "ScavengeServers"
  2763. #define DNS_REGKEY_ZONE_ALLOW_AUTONS "AllowNSRecordsAutoCreation" // IP list
  2764. //
  2765. // Debugging aids
  2766. //
  2767. #define DNS_REGKEY_BREAK_ON_ASC_FAILURE "BreakOnAscFailure" // 0/1 - ASC=AcceptSecurityContext
  2768. #define DNS_REGKEY_BREAK_ON_UPDATE_FROM "BreakOnUpdateFrom" // IP list
  2769. #define DNS_REGKEY_BREAK_ON_RECV_FROM "BreakOnReceiveFrom" // IP list
  2770. #define DNS_REGKEY_ZONE_BREAK_ON_NAME_UPDATE "BreakOnNameUpdate" // node name
  2771. //
  2772. // Property defaults
  2773. //
  2774. // DCR_CLEANUP: remove PROP_BOOT_X flags
  2775. #define PROP_BOOT_REGISTRY (1)
  2776. #define PROP_BOOT_FILE (0)
  2777. #define DNS_DEFAULT_BOOT_REGISTRY (PROP_BOOT_REGISTRY)
  2778. #define DNS_DEFAULT_BOOT_METHOD (BOOT_METHOD_UNINITIALIZED)
  2779. #define DNS_DEFAULT_RPC_PROTOCOL (0xffffffff)
  2780. #define DNS_DEFAULT_LOG_LEVEL (0)
  2781. #define DNS_DEFAULT_LOG_FILE_MAX_SIZE (500000000) // 500 MB
  2782. #define DNS_DEFAULT_EVENTLOG_LEVEL (EVENTLOG_INFORMATION_TYPE)
  2783. #define DNS_DEFAULT_USE_SYSTEM_EVENTLOG FALSE
  2784. #define DNS_DEFAULT_DEBUG_LEVEL (0)
  2785. #define DNS_DEFAULT_SEND_PORT (0)
  2786. #define DNS_DEFAULT_NO_TCP FALSE
  2787. #define DNS_DEFAULT_DISJOINT_NETS FALSE
  2788. #define DNS_DEFAULT_SEND_ON_NON_DNS_PORT FALSE
  2789. #define DNS_DEFAULT_XFR_CONNECT_TIMEOUT (30) // 30 seconds
  2790. #define DNS_DEFAULT_NO_RECURSION FALSE
  2791. #define DNS_DEFAULT_RECURSE_SINGLE_LABEL FALSE
  2792. #define DNS_DEFAULT_MAX_CACHE_TTL (86400) // 1 day
  2793. #define DNS_DEFAULT_MAX_NEGATIVE_CACHE_TTL (900) // 15 minutes
  2794. #define DNS_DEFAULT_SECURE_RESPONSES FALSE
  2795. #define DNS_DEFAULT_RECURSION_RETRY (3) // 3 seconds
  2796. #define DNS_DEFAULT_RECURSION_TIMEOUT (15) // 15 seconds
  2797. #define DNS_DEFAULT_ADDITIONAL_RECURSION_TIMEOUT (15) // 15 seconds
  2798. #define DNS_DEFAULT_FORWARD_TIMEOUT (5) // 5 seconds
  2799. #define DNS_DEFAULT_SLAVE FALSE
  2800. #define DNS_DEFAULT_FORWARD_DELEGATIONS FALSE
  2801. #define DNS_DEFAULT_INET_RECURSE_TO_ROOT_MASK 0xFFFFFFFF // all ON by default
  2802. #define DNS_DEFAULT_NO_AUTO_REVERSE_ZONES FALSE
  2803. #define DNS_DEFAULT_DS_POLLING_INTERVAL (300) // 5 minutes
  2804. #define DNS_DEFAULT_DS_TOMBSTONE_INTERVAL (604800) // 1 week
  2805. #define DNS_DEFAULT_AUTO_CACHE_UPDATE FALSE
  2806. #define DNS_DEFAULT_ALLOW_UPDATE ZONE_UPDATE_UNSECURE
  2807. #define DNS_DEFAULT_NO_UPDATE_DELEGATIONS FALSE
  2808. #define DNS_DEFAULT_DISABLE_AUTO_NS_RECORDS FALSE
  2809. #define DNS_DEFAULT_NAME_CHECK_FLAG DNS_ALLOW_MULTIBYTE_NAMES
  2810. #define DNS_DEFAULT_ROUND_ROBIN TRUE
  2811. #define DNS_DEFAULT_ADDRESS_ANSWER_LIMIT (0)
  2812. #define DNS_DEFAULT_BIND_SECONDARIES TRUE
  2813. #define DNS_DEFAULT_WRITE_AUTHORITY_NS FALSE
  2814. #define DNS_DEFAULT_STRICT_FILE_PARSING FALSE
  2815. #define DNS_DEFAULT_DELETE_OUTSIDE_GLUE FALSE
  2816. #define DNS_DEFAULT_LOOSE_WILDCARDING FALSE
  2817. #define DNS_DEFAULT_WILDCARD_ALL_TYPES FALSE
  2818. #define DNS_DEFAULT_APPEND_MS_XFR_TAG TRUE
  2819. #define DNS_DEFAULT_SCAVENGING_INTERVAL (0) // scavenging OFF
  2820. #define DNS_DEFAULT_SCAVENGING_INTERVAL_ON (168) // a week, 7*24 hours
  2821. #define DNS_DEFAULT_AGING_STATE FALSE
  2822. #define DNS_DEFAULT_NOREFRESH_INTERVAL (168) // a week, 7*24 hours
  2823. #define DNS_DEFAULT_REFRESH_INTERVAL (168) // a week (7*24)
  2824. #define DNS_SERVER_UNLIMITED_CACHE_SIZE ((DWORD)-1) // default: no limit
  2825. #define DNS_DEFAULT_LOCAL_NET_PRIORITY TRUE
  2826. #define DNS_DEFAULT_LOCAL_NET_PRIORITY_NETMASK 0x000000FF // sort down to class C netmask
  2827. #define DNS_DEFAULT_FOREST_DP_BASE "ForestDnsZones"
  2828. #define DNS_DEFAULT_DOMAIN_DP_BASE "DomainDnsZones"
  2829. #define DNS_DEFAULT_AUTO_CREATION_DELEGATIONS DNS_ACD_ONLY_IF_NO_DELEGATION_IN_PARENT
  2830. #define DNS_DNSSEC_ENABLE_DEFAULT DNS_DNSSEC_ENABLED_IF_EDNS
  2831. //
  2832. // Operations
  2833. //
  2834. // In addition to resetting properties, the following operations
  2835. // are available.
  2836. //
  2837. // Server operations
  2838. #define DNSSRV_OP_RESET_DWORD_PROPERTY "ResetDwordProperty"
  2839. #define DNSSRV_OP_RESTART "Restart"
  2840. #define DNSSRV_OP_DEBUG_BREAK "DebugBreak"
  2841. #define DNSSRV_OP_CLEAR_DEBUG_LOG "ClearDebugLog"
  2842. #define DNSSRV_OP_ROOT_BREAK "RootBreak"
  2843. #define DNSSRV_OP_CLEAR_CACHE "ClearCache"
  2844. #define DNSSRV_OP_WRITE_DIRTY_ZONES "WriteDirtyZones"
  2845. #define DNSSRV_OP_ZONE_CREATE "ZoneCreate"
  2846. #define DNSSRV_OP_CLEAR_STATISTICS "ClearStatistics"
  2847. #define DNSSRV_OP_ENUM_ZONES "EnumZones"
  2848. #define DNSSRV_OP_ENUM_DPS "EnumDirectoryPartitions"
  2849. #define DNSSRV_OP_DP_INFO "DirectoryPartitionInfo"
  2850. #define DNSSRV_OP_ENLIST_DP "EnlistDirectoryPartition"
  2851. #define DNSSRV_OP_SETUP_DFLT_DPS "SetupDefaultDirectoryPartitions"
  2852. #define DNSSRV_OP_ENUM_RECORDS "EnumRecords"
  2853. #define DNSSRV_OP_START_SCAVENGING "StartScavenging"
  2854. #define DNSSRV_OP_ABORT_SCAVENGING "AbortScavenging"
  2855. // Zone operations
  2856. #define DNSSRV_OP_ZONE_TYPE_RESET "ZoneTypeReset"
  2857. #define DNSSRV_OP_ZONE_PAUSE "PauseZone"
  2858. #define DNSSRV_OP_ZONE_RESUME "ResumeZone"
  2859. #define DNSSRV_OP_ZONE_LOCK "LockZone"
  2860. #define DNSSRV_OP_ZONE_DELETE "DeleteZone"
  2861. #define DNSSRV_OP_ZONE_RELOAD "ReloadZone"
  2862. #define DNSSRV_OP_ZONE_REFRESH "RefreshZone"
  2863. #define DNSSRV_OP_ZONE_EXPIRE "ExpireZone"
  2864. #define DNSSRV_OP_ZONE_INCREMENT_VERSION "IncrementVersion"
  2865. #define DNSSRV_OP_ZONE_WRITE_BACK_FILE "WriteBackFile"
  2866. #define DNSSRV_OP_ZONE_WRITE_ANSI_FILE "WriteAnsiFile"
  2867. #define DNSSRV_OP_ZONE_DELETE_FROM_DS "DeleteZoneFromDs"
  2868. #define DNSSRV_OP_ZONE_UPDATE_FROM_DS "UpdateZoneFromDs"
  2869. #define DNSSRV_OP_ZONE_RENAME "ZoneRename"
  2870. #define DNSSRV_OP_ZONE_EXPORT "ZoneExport"
  2871. #define DNSSRV_OP_ZONE_CHANGE_DP "ZoneChangeDirectoryPartition"
  2872. #define DNSSRV_OP_UPDATE_RECORD "UpdateRecord"
  2873. #define DNSSRV_OP_DELETE_NODE "DeleteNode"
  2874. #define DNSSRV_OP_ZONE_DELETE_NODE DNSSRV_OP_DELETE_NODE
  2875. #define DNSSRV_OP_DELETE_RECORD_SET "DeleteRecordSet"
  2876. #define DNSSRV_OP_FORCE_AGING_ON_NODE "ForceAgingOnNode"
  2877. //
  2878. // Special non-property queries
  2879. //
  2880. #define DNSSRV_QUERY_DWORD_PROPERTY "QueryDwordProperty"
  2881. #define DNSSRV_QUERY_STRING_PROPERTY "QueryStringProperty"
  2882. #define DNSSRV_QUERY_IPLIST_PROPERTY "QueryIPListProperty"
  2883. #define DNSSRV_QUERY_SERVER_INFO "ServerInfo"
  2884. #define DNSSRV_QUERY_STATISTICS "Statistics"
  2885. #define DNSSRV_QUERY_ZONE_HANDLE "ZoneHandle"
  2886. #define DNSSRV_QUERY_ZONE "Zone"
  2887. #define DNSSRV_QUERY_ZONE_INFO "ZoneInfo"
  2888. //
  2889. // Values for DNS_RPC_NAME_AND_PARAM.dwParam
  2890. //
  2891. //
  2892. #define DNSSRV_OP_PARAM_APPLY_ALL_ZONES 0x10000000
  2893. #define REMOVE_APPLY_ALL_BIT(val) ((LONG)val &= (~DNSSRV_OP_PARAM_APPLY_ALL_ZONES) )
  2894. //
  2895. // Log levels for setting LogLevel property
  2896. //
  2897. #define DNS_LOG_LEVEL_ALL_PACKETS 0x0000ffff
  2898. #define DNS_LOG_LEVEL_NON_QUERY 0x000000fe
  2899. #define DNS_LOG_LEVEL_QUERY 0x00000001
  2900. #define DNS_LOG_LEVEL_NOTIFY 0x00000010
  2901. #define DNS_LOG_LEVEL_UPDATE 0x00000020
  2902. #define DNS_LOG_LEVEL_QUESTIONS 0x00000100
  2903. #define DNS_LOG_LEVEL_ANSWERS 0x00000200
  2904. #define DNS_LOG_LEVEL_SEND 0x00001000
  2905. #define DNS_LOG_LEVEL_RECV 0x00002000
  2906. #define DNS_LOG_LEVEL_UDP 0x00004000
  2907. #define DNS_LOG_LEVEL_TCP 0x00008000
  2908. #define DNS_LOG_LEVEL_DS_WRITE 0x00010000
  2909. #define DNS_LOG_LEVEL_DS_UPDATE 0x00020000
  2910. #define DNS_LOG_LEVEL_FULL_PACKETS 0x01000000
  2911. #define DNS_LOG_LEVEL_WRITE_THROUGH 0x80000000
  2912. //
  2913. // Settings for BootMethod property
  2914. //
  2915. #define BOOT_METHOD_UNINITIALIZED (0)
  2916. #define BOOT_METHOD_FILE (1)
  2917. #define BOOT_METHOD_REGISTRY (2)
  2918. #define BOOT_METHOD_DIRECTORY (3)
  2919. #define BOOT_METHOD_DEFAULT (BOOT_METHOD_DIRECTORY)
  2920. // Server, default aging property
  2921. #define DNS_AGING_OFF (0)
  2922. #define DNS_AGING_DS_ZONES (0x0000001)
  2923. #define DNS_AGING_NON_DS_ZONES (0x0000002)
  2924. #define DNS_AGING_ALL_ZONES (0x0000003)
  2925. //
  2926. // Union of RPC types
  2927. //
  2928. // This allows us to write very general API taking UNION type
  2929. // with is extensible simply by adding operationa and types.
  2930. // RPC simply packs\unpacks the UNION type appropriately.
  2931. //
  2932. // Note, that UNION is actually union of pointers to types, so
  2933. // that data can be passed between the API and the RPC stubs (on the client)
  2934. // or dispatched (on the server) efficiently.
  2935. //
  2936. typedef enum _DnssrvRpcTypeId
  2937. {
  2938. DNSSRV_TYPEID_ANY = ( -1 ),
  2939. DNSSRV_TYPEID_NULL = 0,
  2940. DNSSRV_TYPEID_DWORD,
  2941. DNSSRV_TYPEID_LPSTR,
  2942. DNSSRV_TYPEID_LPWSTR,
  2943. DNSSRV_TYPEID_IPARRAY,
  2944. DNSSRV_TYPEID_BUFFER, // 5
  2945. DNSSRV_TYPEID_SERVER_INFO_W2K,
  2946. DNSSRV_TYPEID_STATS,
  2947. DNSSRV_TYPEID_FORWARDERS_W2K,
  2948. DNSSRV_TYPEID_ZONE_W2K,
  2949. DNSSRV_TYPEID_ZONE_INFO_W2K, // 10
  2950. DNSSRV_TYPEID_ZONE_SECONDARIES_W2K,
  2951. DNSSRV_TYPEID_ZONE_DATABASE_W2K,
  2952. DNSSRV_TYPEID_ZONE_TYPE_RESET_W2K,
  2953. DNSSRV_TYPEID_ZONE_CREATE_W2K,
  2954. DNSSRV_TYPEID_NAME_AND_PARAM, // 15
  2955. DNSSRV_TYPEID_ZONE_LIST_W2K,
  2956. //
  2957. // Below this point is Whistler.
  2958. //
  2959. DNSSRV_TYPEID_ZONE_RENAME,
  2960. DNSSRV_TYPEID_ZONE_EXPORT,
  2961. DNSSRV_TYPEID_SERVER_INFO,
  2962. DNSSRV_TYPEID_FORWARDERS, // 20
  2963. DNSSRV_TYPEID_ZONE,
  2964. DNSSRV_TYPEID_ZONE_INFO,
  2965. DNSSRV_TYPEID_ZONE_SECONDARIES,
  2966. DNSSRV_TYPEID_ZONE_DATABASE,
  2967. DNSSRV_TYPEID_ZONE_TYPE_RESET, // 25
  2968. DNSSRV_TYPEID_ZONE_CREATE,
  2969. DNSSRV_TYPEID_ZONE_LIST,
  2970. DNSSRV_TYPEID_DP_ENUM,
  2971. DNSSRV_TYPEID_DP_INFO,
  2972. DNSSRV_TYPEID_DP_LIST,
  2973. DNSSRV_TYPEID_ENLIST_DP,
  2974. DNSSRV_TYPEID_ZONE_CHANGE_DP
  2975. }
  2976. DNS_RPC_TYPEID, *PDNS_RPC_TYPEID;
  2977. #ifdef MIDL_PASS
  2978. typedef [switch_type(DWORD)] union _DnssrvSrvRpcUnion
  2979. {
  2980. [case(DNSSRV_TYPEID_NULL)] PBYTE Null;
  2981. [case(DNSSRV_TYPEID_DWORD)] DWORD Dword;
  2982. [case(DNSSRV_TYPEID_LPSTR)] LPSTR String;
  2983. [case(DNSSRV_TYPEID_LPWSTR)] LPWSTR WideString;
  2984. [case(DNSSRV_TYPEID_IPARRAY)] PIP_ARRAY IpArray;
  2985. [case(DNSSRV_TYPEID_BUFFER)]
  2986. PDNS_RPC_BUFFER Buffer;
  2987. [case(DNSSRV_TYPEID_SERVER_INFO_W2K)]
  2988. PDNS_RPC_SERVER_INFO_W2K ServerInfoW2K;
  2989. [case(DNSSRV_TYPEID_STATS)]
  2990. PDNSSRV_STATS Stats;
  2991. [case(DNSSRV_TYPEID_FORWARDERS_W2K)]
  2992. PDNS_RPC_FORWARDERS_W2K ForwardersW2K;
  2993. [case(DNSSRV_TYPEID_ZONE_W2K)]
  2994. PDNS_RPC_ZONE_W2K ZoneW2K;
  2995. [case(DNSSRV_TYPEID_ZONE_INFO_W2K)]
  2996. PDNS_RPC_ZONE_INFO_W2K ZoneInfoW2K;
  2997. [case(DNSSRV_TYPEID_ZONE_SECONDARIES_W2K)]
  2998. PDNS_RPC_ZONE_SECONDARIES_W2K SecondariesW2K;
  2999. [case(DNSSRV_TYPEID_ZONE_DATABASE_W2K)]
  3000. PDNS_RPC_ZONE_DATABASE_W2K DatabaseW2K;
  3001. [case(DNSSRV_TYPEID_ZONE_TYPE_RESET_W2K)]
  3002. PDNS_RPC_ZONE_TYPE_RESET_W2K TypeResetW2K;
  3003. [case(DNSSRV_TYPEID_ZONE_CREATE_W2K)]
  3004. PDNS_RPC_ZONE_CREATE_INFO_W2K ZoneCreateW2K;
  3005. [case(DNSSRV_TYPEID_NAME_AND_PARAM)]
  3006. PDNS_RPC_NAME_AND_PARAM NameAndParam;
  3007. [case(DNSSRV_TYPEID_ZONE_LIST_W2K)]
  3008. PDNS_RPC_ZONE_LIST_W2K ZoneListW2K;
  3009. //
  3010. // Below this point is Whistler.
  3011. //
  3012. [case(DNSSRV_TYPEID_SERVER_INFO)]
  3013. PDNS_RPC_SERVER_INFO ServerInfo;
  3014. [case(DNSSRV_TYPEID_FORWARDERS)]
  3015. PDNS_RPC_FORWARDERS Forwarders;
  3016. [case(DNSSRV_TYPEID_ZONE)]
  3017. PDNS_RPC_ZONE Zone;
  3018. [case(DNSSRV_TYPEID_ZONE_INFO)]
  3019. PDNS_RPC_ZONE_INFO ZoneInfo;
  3020. [case(DNSSRV_TYPEID_ZONE_SECONDARIES)]
  3021. PDNS_RPC_ZONE_SECONDARIES Secondaries;
  3022. [case(DNSSRV_TYPEID_ZONE_DATABASE)]
  3023. PDNS_RPC_ZONE_DATABASE Database;
  3024. [case(DNSSRV_TYPEID_ZONE_TYPE_RESET)]
  3025. PDNS_RPC_ZONE_TYPE_RESET TypeReset;
  3026. [case(DNSSRV_TYPEID_ZONE_CREATE)]
  3027. PDNS_RPC_ZONE_CREATE_INFO ZoneCreate;
  3028. [case(DNSSRV_TYPEID_ZONE_LIST)]
  3029. PDNS_RPC_ZONE_LIST ZoneList;
  3030. [case(DNSSRV_TYPEID_ZONE_RENAME)]
  3031. PDNS_RPC_ZONE_RENAME_INFO ZoneRename;
  3032. [case(DNSSRV_TYPEID_ZONE_EXPORT)]
  3033. PDNS_RPC_ZONE_EXPORT_INFO ZoneExport;
  3034. [case(DNSSRV_TYPEID_DP_INFO)]
  3035. PDNS_RPC_DP_INFO DirectoryPartition;
  3036. [case(DNSSRV_TYPEID_DP_ENUM)]
  3037. PDNS_RPC_DP_ENUM DirectoryPartitionEnum;
  3038. [case(DNSSRV_TYPEID_DP_LIST)]
  3039. PDNS_RPC_DP_LIST DirectoryPartitionList;
  3040. [case(DNSSRV_TYPEID_ENLIST_DP)]
  3041. PDNS_RPC_ENLIST_DP EnlistDirectoryPartition;
  3042. [case(DNSSRV_TYPEID_ZONE_CHANGE_DP)]
  3043. PDNS_RPC_ZONE_CHANGE_DP ZoneChangeDirectoryPartition;
  3044. }
  3045. DNSSRV_RPC_UNION;
  3046. #else
  3047. typedef union _DnssrvSrvRpcUnion
  3048. {
  3049. PBYTE Null;
  3050. DWORD Dword;
  3051. LPSTR String;
  3052. LPWSTR WideString;
  3053. PIP_ARRAY IpArray;
  3054. PDNS_RPC_BUFFER Buffer;
  3055. PDNS_RPC_SERVER_INFO_W2K ServerInfoW2K;
  3056. PDNSSRV_STATS Stats;
  3057. PDNS_RPC_FORWARDERS_W2K ForwardersW2K;
  3058. PDNS_RPC_ZONE_W2K ZoneW2K;
  3059. PDNS_RPC_ZONE_INFO_W2K ZoneInfoW2K;
  3060. PDNS_RPC_ZONE_SECONDARIES_W2K SecondariesW2K;
  3061. PDNS_RPC_ZONE_DATABASE_W2K DatabaseW2K;
  3062. PDNS_RPC_ZONE_TYPE_RESET_W2K TypeResetW2K;
  3063. PDNS_RPC_ZONE_CREATE_INFO_W2K ZoneCreateW2K;
  3064. PDNS_RPC_NAME_AND_PARAM NameAndParam;
  3065. PDNS_RPC_ZONE_LIST_W2K ZoneListW2K;
  3066. PDNS_RPC_SERVER_INFO ServerInfo;
  3067. PDNS_RPC_FORWARDERS Forwarders;
  3068. PDNS_RPC_ZONE Zone;
  3069. PDNS_RPC_ZONE_INFO ZoneInfo;
  3070. PDNS_RPC_ZONE_SECONDARIES Secondaries;
  3071. PDNS_RPC_ZONE_DATABASE Database;
  3072. PDNS_RPC_ZONE_TYPE_RESET TypeReset;
  3073. PDNS_RPC_ZONE_CREATE_INFO ZoneCreate;
  3074. PDNS_RPC_ZONE_LIST ZoneList;
  3075. PDNS_RPC_ZONE_RENAME_INFO ZoneRename;
  3076. PDNS_RPC_ZONE_EXPORT_INFO ZoneExport;
  3077. PDNS_RPC_DP_INFO DirectoryPartition;
  3078. PDNS_RPC_DP_ENUM DirectoryPartitionEnum;
  3079. PDNS_RPC_DP_LIST DirectoryPartitionList;
  3080. PDNS_RPC_ENLIST_DP EnlistDirectoryPartition;
  3081. PDNS_RPC_ZONE_CHANGE_DP ZoneResetDirectoryPartition;
  3082. //
  3083. // should add DNS_RECORD and DNS_NODE
  3084. //
  3085. }
  3086. DNSSRV_RPC_UNION;
  3087. #endif
  3088. //
  3089. // General Query and Operation API
  3090. //
  3091. // Many of the API above are not remoteable but rather use these
  3092. // API to contact the server. The data fields are actually the
  3093. // DNSSRV_RPC_UNION of pointers given above.
  3094. //
  3095. // Client version is a 32 bit private version number in the format:
  3096. // HIGH WORD - major OS version
  3097. // LOW WORD - minor private version to allow for service packs, etc.
  3098. //
  3099. #define MAKE_DNS_CLIENT_VERSION( hiWord, loWord ) \
  3100. ( ( DWORD ) ( ( ( hiWord & 0xFFFF ) << 16 ) | ( loWord & 0xFFFF ) ) )
  3101. #define DNS_RPC_WHISTLER_MAJOR_VER 6 // 6 for Whistler
  3102. #define DNS_RPC_WHISTLER_CURRENT_MINOR_VER 0 // increment as required
  3103. #define DNS_RPC_W2K_CLIENT_VERSION 0 // W2K does not send ver
  3104. #define DNS_RPC_CURRENT_CLIENT_VER \
  3105. MAKE_DNS_CLIENT_VERSION( \
  3106. DNS_RPC_WHISTLER_MAJOR_VER, \
  3107. DNS_RPC_WHISTLER_CURRENT_MINOR_VER )
  3108. DNS_STATUS
  3109. DnssrvOperationEx(
  3110. IN DWORD dwClientVersion,
  3111. IN DWORD dwSettingFlags,
  3112. IN LPCWSTR pwszServer,
  3113. IN LPCSTR pszZone,
  3114. IN DWORD dwContext,
  3115. IN LPCSTR pszOperation,
  3116. IN DWORD dwTypeId,
  3117. IN PVOID Data
  3118. );
  3119. #define DnssrvOperation( s, z, op, id, d ) \
  3120. DnssrvOperationEx( DNS_RPC_CURRENT_CLIENT_VER, \
  3121. 0, (s), (z), 0, (op), (id), (d) )
  3122. DNS_STATUS
  3123. DnssrvQueryEx(
  3124. IN DWORD dwClientVersion,
  3125. IN DWORD dwSettingFlags,
  3126. IN LPCWSTR pwszServer,
  3127. IN LPCSTR pszZone,
  3128. IN LPCSTR pszOperation,
  3129. OUT PDWORD pdwTypeId,
  3130. OUT PVOID * pData
  3131. );
  3132. #define DnssrvQuery( s, z, op, id, d ) \
  3133. DnssrvQueryEx( DNS_RPC_CURRENT_CLIENT_VER, \
  3134. 0, (s), (z), (op), (id), (d) )
  3135. DNS_STATUS
  3136. DNS_API_FUNCTION
  3137. DnssrvComplexOperationEx(
  3138. IN DWORD dwClientVersion,
  3139. IN DWORD dwSettingFlags,
  3140. IN LPCWSTR pwszServer,
  3141. IN LPCSTR pszZone,
  3142. IN LPCSTR pszQuery,
  3143. IN DWORD dwTypeIn,
  3144. IN PVOID pDataIn,
  3145. OUT PDWORD pdwTypeOut,
  3146. OUT PVOID * ppDataOutOut
  3147. );
  3148. #define DnssrvComplexOperation( s, z, q, typein, din, typeout, dout ) \
  3149. DnssrvComplexOperationEx( DNS_RPC_CURRENT_CLIENT_VER, \
  3150. 0, (s), (z), (q), (typein), (din), (typeout), (dout) )
  3151. //
  3152. // DWORD properties query\reset are a common case
  3153. //
  3154. DNS_STATUS
  3155. DNS_API_FUNCTION
  3156. DnssrvQueryDwordPropertyEx(
  3157. IN DWORD dwClientVersion,
  3158. IN DWORD dwSettingFlags,
  3159. IN LPCWSTR pwszServer,
  3160. IN LPCSTR pszZone,
  3161. IN LPCSTR pszProperty,
  3162. OUT PDWORD pdwResult
  3163. );
  3164. #define DnssrvQueryDwordProperty( s, z, p, r ) \
  3165. DnssrvQueryDwordPropertyEx( DNS_RPC_CURRENT_CLIENT_VER, \
  3166. 0, (s), (z), (p), (r) )
  3167. DNS_STATUS
  3168. DNS_API_FUNCTION
  3169. DnssrvResetDwordPropertyEx(
  3170. IN DWORD dwClientVersion,
  3171. IN DWORD dwSettingFlags,
  3172. IN LPCWSTR pwszServer,
  3173. IN LPCSTR pszZone,
  3174. IN DWORD dwContext,
  3175. IN LPCSTR pszProperty,
  3176. IN DWORD dwPropertyValue
  3177. );
  3178. #define DnssrvResetDwordProperty( s, z, p, v ) \
  3179. DnssrvResetDwordPropertyEx( DNS_RPC_CURRENT_CLIENT_VER, \
  3180. 0, (s), (z), 0, (p), (v) )
  3181. #define DnssrvResetDwordPropertyWithContext( s, z, c, p, v ) \
  3182. DnssrvResetDwordPropertyEx( DNS_RPC_CURRENT_CLIENT_VER, \
  3183. 0, (s), (z), (c), (p), (v) )
  3184. DNS_STATUS
  3185. DNS_API_FUNCTION
  3186. DnssrvResetStringPropertyEx(
  3187. IN DWORD dwClientVersion,
  3188. IN DWORD dwSettingFlags,
  3189. IN LPCWSTR pwszServerName,
  3190. IN LPCSTR pszZone,
  3191. IN DWORD dwContext,
  3192. IN LPCSTR pszProperty,
  3193. IN LPCWSTR pswzPropertyValue,
  3194. IN DWORD dwFlags
  3195. );
  3196. #define DnssrvResetStringProperty( server, zone, prop, value, flags ) \
  3197. DnssrvResetStringPropertyEx( DNS_RPC_CURRENT_CLIENT_VER, \
  3198. 0, (server), (zone), 0, (prop), (value), (flags) )
  3199. DNS_STATUS
  3200. DNS_API_FUNCTION
  3201. DnssrvResetIPListPropertyEx(
  3202. IN DWORD dwClientVersion,
  3203. IN DWORD dwSettingFlags,
  3204. IN LPCWSTR pwszServerName,
  3205. IN LPCSTR pszZone,
  3206. IN DWORD dwContext,
  3207. IN LPCSTR pszProperty,
  3208. IN PIP_ARRAY pipArray,
  3209. IN DWORD dwFlags
  3210. );
  3211. #define DnssrvResetIPListProperty( server, zone, prop, value, flags ) \
  3212. DnssrvResetIPListPropertyEx( DNS_RPC_CURRENT_CLIENT_VER, \
  3213. 0, (server), (zone), 0, (prop), (value), (flags) )
  3214. //
  3215. // RPC-related functions shared by client and server
  3216. //
  3217. #ifndef MIDL_PASS
  3218. //
  3219. // Conversion from obsolete to current RPC structures.
  3220. //
  3221. DNS_STATUS
  3222. DNS_API_FUNCTION
  3223. DnsRpc_ConvertToCurrent(
  3224. IN PDWORD pdwTypeId, IN OUT
  3225. IN PVOID * ppData IN OUT
  3226. );
  3227. //
  3228. // Print any type in RPC Union
  3229. //
  3230. VOID
  3231. DnsPrint_RpcUnion(
  3232. IN PRINT_ROUTINE PrintRoutine,
  3233. IN OUT PPRINT_CONTEXT pPrintContext,
  3234. IN LPSTR pszHeader,
  3235. IN DWORD dwTypeId,
  3236. IN PVOID pData
  3237. );
  3238. //
  3239. // Server info printing
  3240. //
  3241. VOID
  3242. DnsPrint_RpcServerInfo(
  3243. IN PRINT_ROUTINE PrintRoutine,
  3244. IN OUT PPRINT_CONTEXT pPrintContext,
  3245. IN LPSTR pszHeader,
  3246. IN PDNS_RPC_SERVER_INFO pServerInfo
  3247. );
  3248. VOID
  3249. DnsPrint_RpcServerInfo_W2K(
  3250. IN PRINT_ROUTINE PrintRoutine,
  3251. IN OUT PPRINT_CONTEXT pPrintContext,
  3252. IN LPSTR pszHeader,
  3253. IN PDNS_RPC_SERVER_INFO_W2K pServerInfo
  3254. );
  3255. VOID
  3256. DnsPrint_RpcSingleStat(
  3257. IN PRINT_ROUTINE PrintRoutine,
  3258. IN OUT PPRINT_CONTEXT pPrintContext,
  3259. IN LPSTR pszHeader,
  3260. IN PDNSSRV_STAT pStat
  3261. );
  3262. VOID
  3263. DnsPrint_RpcStatsBuffer(
  3264. IN PRINT_ROUTINE PrintRoutine,
  3265. IN OUT PPRINT_CONTEXT pPrintContext,
  3266. IN LPSTR pszHeader,
  3267. IN PDNS_RPC_BUFFER pBuffer
  3268. );
  3269. VOID
  3270. DnsPrint_RpcStatRaw(
  3271. IN PRINT_ROUTINE PrintRoutine,
  3272. IN OUT PPRINT_CONTEXT pPrintContext,
  3273. IN LPSTR pszHeader,
  3274. IN PDNSSRV_STAT pStat,
  3275. IN DNS_STATUS Status
  3276. );
  3277. //
  3278. // Zone info printing
  3279. //
  3280. VOID
  3281. DnsPrint_RpcZone(
  3282. IN PRINT_ROUTINE PrintRoutine,
  3283. IN OUT PPRINT_CONTEXT pPrintContext,
  3284. IN LPSTR pszHeader,
  3285. IN PDNS_RPC_ZONE pZone
  3286. );
  3287. VOID
  3288. DnsPrint_RpcZone_W2K(
  3289. IN PRINT_ROUTINE PrintRoutine,
  3290. IN OUT PPRINT_CONTEXT pPrintContext,
  3291. IN LPSTR pszHeader,
  3292. IN PDNS_RPC_ZONE_W2K pZone
  3293. );
  3294. VOID
  3295. DnsPrint_RpcZoneList(
  3296. IN PRINT_ROUTINE PrintRoutine,
  3297. IN OUT PPRINT_CONTEXT pPrintContext,
  3298. IN LPSTR pszHeader,
  3299. IN PDNS_RPC_ZONE_LIST pZoneList
  3300. );
  3301. VOID
  3302. DnsPrint_RpcZoneList_W2K(
  3303. IN PRINT_ROUTINE PrintRoutine,
  3304. IN OUT PPRINT_CONTEXT pPrintContext,
  3305. IN LPSTR pszHeader,
  3306. IN PDNS_RPC_ZONE_LIST_W2K pZoneList
  3307. );
  3308. VOID
  3309. DnsPrint_RpcZoneInfo(
  3310. IN PRINT_ROUTINE PrintRoutine,
  3311. IN OUT PPRINT_CONTEXT pPrintContext,
  3312. IN LPSTR pszHeader,
  3313. IN PDNS_RPC_ZONE_INFO pZoneInfo
  3314. );
  3315. VOID
  3316. DnsPrint_RpcZoneInfo_W2K(
  3317. IN PRINT_ROUTINE PrintRoutine,
  3318. IN OUT PPRINT_CONTEXT pPrintContext,
  3319. IN LPSTR pszHeader,
  3320. IN PDNS_RPC_ZONE_INFO_W2K pZoneInfo
  3321. );
  3322. VOID
  3323. DnsPrint_RpcZoneInfoList(
  3324. IN PRINT_ROUTINE PrintRoutine,
  3325. IN OUT PPRINT_CONTEXT pPrintContext,
  3326. IN LPSTR pszHeader,
  3327. IN DWORD dwZoneCount,
  3328. IN PDNS_RPC_ZONE_INFO apZoneInfo[]
  3329. );
  3330. //
  3331. // Directory partition printing
  3332. //
  3333. VOID
  3334. DnsPrint_RpcDpEnum(
  3335. IN PRINT_ROUTINE PrintRoutine,
  3336. IN OUT PPRINT_CONTEXT pPrintContext,
  3337. IN LPSTR pszHeader,
  3338. IN PDNS_RPC_DP_ENUM pDp
  3339. );
  3340. VOID
  3341. DnsPrint_RpcDpInfo(
  3342. IN PRINT_ROUTINE PrintRoutine,
  3343. IN OUT PPRINT_CONTEXT pPrintContext,
  3344. IN LPSTR pszHeader,
  3345. IN PDNS_RPC_DP_INFO pDp,
  3346. IN BOOL fTruncateLongStrings
  3347. );
  3348. VOID
  3349. DNS_API_FUNCTION
  3350. DnsPrint_RpcDpList(
  3351. IN PRINT_ROUTINE PrintRoutine,
  3352. IN OUT PPRINT_CONTEXT pPrintContext,
  3353. IN LPSTR pszHeader,
  3354. IN PDNS_RPC_DP_LIST pDpList
  3355. );
  3356. //
  3357. // Node and record buffer printing
  3358. //
  3359. VOID
  3360. DnsPrint_RpcName(
  3361. IN PRINT_ROUTINE PrintRoutine,
  3362. IN OUT PPRINT_CONTEXT pPrintContext,
  3363. IN LPSTR pszHeader,
  3364. IN PDNS_RPC_NAME pName,
  3365. IN LPSTR pszTrailer
  3366. );
  3367. VOID
  3368. DnsPrint_RpcNode(
  3369. IN PRINT_ROUTINE PrintRoutine,
  3370. IN OUT PPRINT_CONTEXT pPrintContext,
  3371. IN LPSTR pszHeader,
  3372. IN PDNS_RPC_NODE pNode
  3373. );
  3374. VOID
  3375. DnsPrint_RpcRecord(
  3376. IN PRINT_ROUTINE PrintRoutine,
  3377. IN OUT PPRINT_CONTEXT pPrintContext,
  3378. IN LPSTR pszHeader,
  3379. IN BOOL fDetail,
  3380. IN PDNS_RPC_RECORD pRecord
  3381. );
  3382. PDNS_RPC_NAME
  3383. DnsPrint_RpcRecordsInBuffer(
  3384. IN PRINT_ROUTINE PrintRoutine,
  3385. IN OUT PPRINT_CONTEXT pPrintContext,
  3386. IN LPSTR pszHeader,
  3387. IN BOOL fDetail,
  3388. IN DWORD dwBufferLength,
  3389. IN BYTE abBuffer[]
  3390. );
  3391. VOID
  3392. DNS_API_FUNCTION
  3393. DnsPrint_Node(
  3394. IN PRINT_ROUTINE PrintRoutine,
  3395. IN OUT PPRINT_CONTEXT pPrintContext,
  3396. IN LPSTR pszHeader,
  3397. IN PDNS_NODE pNode,
  3398. IN BOOLEAN fPrintRecords
  3399. );
  3400. VOID
  3401. DNS_API_FUNCTION
  3402. DnsPrint_NodeList(
  3403. IN PRINT_ROUTINE PrintRoutine,
  3404. IN OUT PPRINT_CONTEXT pPrintContext,
  3405. IN LPSTR pszHeader,
  3406. IN PDNS_NODE pNode,
  3407. IN BOOLEAN fPrintRecords
  3408. );
  3409. //
  3410. // Miscellaneous print utility
  3411. //
  3412. #define Dns_SystemHrToSystemTime( t, p ) \
  3413. ( Dns_SystemHourToSystemTime( (t),(p) ), TRUE )
  3414. VOID
  3415. Dns_SystemHourToSystemTime(
  3416. IN DWORD dwHourTime,
  3417. IN OUT PSYSTEMTIME pSystemTime
  3418. );
  3419. //
  3420. // Debug printing utils
  3421. //
  3422. VOID
  3423. DNS_API_FUNCTION
  3424. DnssrvInitializeDebug(
  3425. VOID
  3426. );
  3427. // RPC debug print defs
  3428. #if DBG
  3429. #define DnsDbg_RpcUnion(a,b,c) DnsPrint_RpcUnion(DnsPR,NULL,a,b,c)
  3430. #define DnsDbg_RpcServerInfo(a,b) DnsPrint_RpcServerInfo(DnsPR,NULL,a,b)
  3431. #define DnsDbg_RpcServerInfo_W2K(a,b) DnsPrint_RpcServerInfo_W2K(DnsPR,NULL,a,b)
  3432. #define DnsDbg_RpcSingleStat(a,b) DnsPrint_RpcSingleStat(DnsPR,NULL,a,b)
  3433. #define DnsDbg_RpcStatRaw(a,b) DnsPrint_RpcStatRaw(DnsPR,NULL,a,b,c)
  3434. #define DnsDbg_RpcStatsBuffer(a,b) DnsPrint_RpcStatsBuffer(DnsPR,NULL,a,b)
  3435. #define DnsDbg_RpcZone(a,b) DnsPrint_RpcZone(DnsPR,NULL,a,b)
  3436. #define DnsDbg_RpcZone_W2K(a,b) DnsPrint_RpcZone_W2K(DnsPR,NULL,a,b)
  3437. #define DnsDbg_RpcZoneList(a,b) DnsPrint_RpcZoneList(DnsPR,NULL,a,b)
  3438. #define DnsDbg_RpcZoneList_W2K(a,b) DnsPrint_RpcZoneList_W2K(DnsPR,NULL,a,b)
  3439. #define DnsDbg_RpcZoneHandleList(a,b,c) DnsPrint_RpcZoneHandleList(DnsPR,NULL,a,b,c)
  3440. #define DnsDbg_RpcZoneInfo(a,b) DnsPrint_RpcZoneInfo(DnsPR,NULL,a,b)
  3441. #define DnsDbg_RpcZoneInfo_W2K(a,b) DnsPrint_RpcZoneInfo_W2K(DnsPR,NULL,a,b)
  3442. #define DnsDbg_RpcZoneInfoList(a,b,c) DnsPrint_RpcZoneInfoList(DnsPR,NULL,a,b,c)
  3443. #define DnsDbg_RpcName(a,b,c) DnsPrint_RpcName(DnsPR,NULL,a,b,c)
  3444. #define DnsDbg_RpcNode(a,b) DnsPrint_RpcNode(DnsPR,NULL,a,b)
  3445. #define DnsDbg_RpcRecord(a,b) DnsPrint_RpcRecord(DnsPR,NULL,a,TRUE,b)
  3446. #define DnsDbg_RpcRecordsInBuffer(a,b,c) DnsPrint_RpcRecordsInBuffer(DnsPR,NULL,a,TRUE,b,c)
  3447. #define DnsDbg_RpcDpEnum(psz,pDp) DnsPrint_RpcDpEnum(DnsPR,NULL,psz,pDp)
  3448. #define DnsDbg_RpcDpInfo(psz,pDp,tr) DnsPrint_RpcDpInfo(DnsPR,NULL,psz,pDp,tr)
  3449. #define DnsDbg_RpcDpList(psz,pDpList) DnsPrint_RpcDpList(DnsPR,NULL,psz,pDpList)
  3450. #define DnsDbg_Node(a,b,c) DnsPrint_Node(DnsPR,NULL,a,b,c)
  3451. #define DnsDbg_NodeList(a,b,c) DnsPrint_NodeList(DnsPR,NULL,a,b,c)
  3452. #else // no debug
  3453. #define DnsDbg_RpcUnion(a,b,c)
  3454. #define DnsDbg_RpcServerInfo(a,b)
  3455. #define DnsDbg_RpcServerInfo_W2K(a,b)
  3456. #define DnsDbg_RpcSingleStat(a,b)
  3457. #define DnsDbg_RpcStatsBuffer(a,b)
  3458. #define DnsDbg_RpcZone(a,b)
  3459. #define DnsDbg_RpcZone_W2K(a,b)
  3460. #define DnsDbg_RpcZoneList(a,b)
  3461. #define DnsDbg_RpcZoneList_W2K(a,b)
  3462. #define DnsDbg_RpcZoneHandleList(a,b,c)
  3463. #define DnsDbg_RpcZoneInfo(a,b)
  3464. #define DnsDbg_RpcZoneInfo_W2K(a,b)
  3465. #define DnsDbg_RpcZoneInfoList(a,b,c)
  3466. #define DnsDbg_RpcName(a,b,c)
  3467. #define DnsDbg_RpcNode(a,b)
  3468. #define DnsDbg_RpcRecord(a,b)
  3469. #define DnsDbg_RpcRecordsInBuffer(a,b,c)
  3470. #define DnsDbg_RpcDpEnum(psz,pDp)
  3471. #define DnsDbg_RpcDpInfo(psz,pDp,tr)
  3472. #define DnsDbg_RpcDpList(psz,pDpList)
  3473. #define DnsDbg_Node(a,b,c)
  3474. #define DnsDbg_NodeList(a,b,c)
  3475. #endif // debug
  3476. #endif // no MIDL_PASS
  3477. #ifdef __cplusplus
  3478. }
  3479. #endif // __cplusplus
  3480. #endif // _DNSRPC_INCLUDED_