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.

166 lines
3.2 KiB

  1. /*++
  2. Copyright (c) 1996-1997 Microsoft Corporation
  3. Module Name:
  4. nldns.h
  5. Abstract:
  6. Header for routines to register DNS names.
  7. Author:
  8. Cliff Van Dyke (CliffV) 28-May-1996
  9. Revision History:
  10. --*/
  11. //
  12. // Log file of all names registered in DNS
  13. //
  14. #define NL_DNS_LOG_FILE L"\\system32\\config\\netlogon.dns"
  15. #define NL_DNS_BINARY_LOG_FILE L"\\system32\\config\\netlogon.dnb"
  16. // NL_MAX_DNS_LENGTH for each DNS name plus some slop
  17. #define NL_DNS_RECORD_STRING_SIZE (NL_MAX_DNS_LENGTH*3+30 + 1)
  18. #define NL_DNS_A_RR_VALUE_1 " IN A "
  19. #define NL_DNS_CNAME_RR_VALUE_1 " IN CNAME "
  20. #define NL_DNS_SRV_RR_VALUE_1 " IN SRV "
  21. #define NL_DNS_RR_EOL "\r\n"
  22. //
  23. // Registry key where private data is stored across boots
  24. //
  25. // (This key does NOT have a change notify registered.)
  26. //
  27. #define NL_PRIVATE_KEY "SYSTEM\\CurrentControlSet\\Services\\Netlogon\\Private"
  28. //
  29. // Procedure Forwards for dns.c
  30. //
  31. HKEY
  32. NlOpenNetlogonKey(
  33. LPSTR KeyName
  34. );
  35. NET_API_STATUS
  36. NlGetConfiguredDnsDomainName(
  37. OUT LPWSTR *DnsDomainName
  38. );
  39. NET_API_STATUS
  40. NlDnsInitialize(
  41. VOID
  42. );
  43. VOID
  44. NlDnsScavenge(
  45. IN BOOL NormalScavenge,
  46. IN BOOL RefreshDomainRecords,
  47. IN BOOL ForceRefreshDomainRecords,
  48. IN BOOL ForceReregister
  49. );
  50. VOID
  51. NlDnsForceScavenge(
  52. IN BOOL RefreshDomainRecords,
  53. IN BOOL ForceReregister
  54. );
  55. BOOLEAN
  56. NlDnsHasDnsServers(
  57. VOID
  58. );
  59. NTSTATUS
  60. NlDnsNtdsDsaDeletion (
  61. IN LPWSTR DnsDomainName,
  62. IN GUID *DomainGuid,
  63. IN GUID *DsaGuid,
  64. IN LPWSTR DnsHostName
  65. );
  66. BOOL
  67. NlDnsCheckLastStatus(
  68. VOID
  69. );
  70. //
  71. // Flags affecting DNS scavenging activity
  72. //
  73. //
  74. // Refresh domain records in the global list before doing DNS updates
  75. // if site coverage changes
  76. //
  77. #define NL_DNS_REFRESH_DOMAIN_RECORDS 0x00000001
  78. //
  79. // Refresh domain records in the global list before doing DNS updates
  80. // even if site coverage doesn't change
  81. //
  82. #define NL_DNS_FORCE_REFRESH_DOMAIN_RECORDS 0x00000002
  83. //
  84. // Force re-registration of all previously registered records
  85. //
  86. #define NL_DNS_FORCE_RECORD_REREGISTER 0x00000004
  87. //
  88. // Register <1B> domain browser names
  89. //
  90. #define NL_DNS_FIX_BROWSER_NAMES 0x00000008
  91. //
  92. // When this flag is set, we avoid forced DNS scavenge
  93. // for 5 minutes. This happens when the machine becomes
  94. // stressed with too many induced scavenging requests,
  95. // so it's better to back off for 5 minutes.
  96. //
  97. #define NL_DNS_AVOID_FORCED_SCAVENGE 0x80000000
  98. NET_API_STATUS
  99. NlDnsAddDomainRecords(
  100. IN PDOMAIN_INFO DomainInfo,
  101. IN ULONG Flags
  102. );
  103. NET_API_STATUS
  104. NlDnsAddDomainRecordsWithSiteRefresh(
  105. IN PDOMAIN_INFO DomainInfo,
  106. IN PULONG Flags
  107. );
  108. VOID
  109. NlDnsShutdown(
  110. VOID
  111. );
  112. NET_API_STATUS
  113. NlSetDnsForestName(
  114. PUNICODE_STRING DnsForestName OPTIONAL,
  115. PBOOLEAN DnsForestNameChanged OPTIONAL
  116. );
  117. VOID
  118. NlCaptureDnsForestName(
  119. OUT WCHAR DnsForestName[NL_MAX_DNS_LENGTH+1]
  120. );
  121. BOOL
  122. NlDnsSetAvoidRegisterNameParam(
  123. IN LPTSTR_ARRAY NewDnsAvoidRegisterRecords
  124. );
  125. BOOL
  126. NetpEqualTStrArrays(
  127. LPTSTR_ARRAY TStrArray1 OPTIONAL,
  128. LPTSTR_ARRAY TStrArray2 OPTIONAL
  129. );