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

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