Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

482 lines
18 KiB

  1. #ifndef _WINSCNST_H_
  2. #define _WINSCNST_H_
  3. /*
  4. macros
  5. */
  6. //
  7. // Default values for the various time intervals
  8. //
  9. #define FORTY_MTS 2400
  10. #define TWO_HOURS 7200
  11. #define TWO_DAYS (172800)
  12. #define ONEDAY (TWO_DAYS/2)
  13. #define FOUR_DAYS (TWO_DAYS * 2)
  14. #define SIX_DAYS (TWO_DAYS * 3)
  15. #define EIGHT_DAYS (TWO_DAYS * 4)
  16. #define TWELVE_DAYS (TWO_DAYS * 6)
  17. #define TWENTY_FOUR_DAYS (TWO_DAYS * 12)
  18. #define WINSCNF_TIME_INT_W_SELF_FND_PNRS TWO_HOURS
  19. //
  20. // Minimum number of updates that must be there before a push notification is
  21. // sent
  22. //
  23. #define WINSCNF_MIN_VALID_UPDATE_CNT 20 //the minimum no of updates
  24. //after which a notification
  25. //can be sent. Adjustable
  26. //via the registry
  27. //
  28. // This is the minimum valid Rpl interval. All the scavenging time intervals
  29. // are derived from it.
  30. //
  31. // refer WAIT_TIME_BEFORE_EXITING in rplpush.c
  32. //
  33. #define WINSCNF_MIN_VALID_RPL_INTVL (600) // 10 mts
  34. // this is the minimum valid consistency check interval between the last time
  35. // consistency check finished and the next one starts.
  36. #define WINSCNF_MIN_VALID_INTER_CC_INTVL (3*60*60) // 3 hours.
  37. //
  38. // default name of the db file that will contain the name-address mappings
  39. //
  40. #define WINSCNF_DB_NAME TEXT(".\\wins\\wins.mdb")
  41. #define WINSCNF_DB_NAME_ASCII ".\\wins\\wins.mdb"
  42. //
  43. // NOTE NOTE NOTE
  44. //
  45. // If you change this define to a string that does not have an unexpanded
  46. // string of the form %<string>% make a corresponding change in
  47. // GetNamesOfDataFiles() in winscnf.c.
  48. //
  49. #define WINSCNF_STATIC_DATA_NAME TEXT("%SystemRoot%\\system32\\drivers\\etc\\lmhosts")
  50. //
  51. // names of values stored under the Parameters key for WINS configuration
  52. //
  53. #if defined(DBGSVC) && !defined(WINS_INTERACTIVE)
  54. #define WINSCNF_DBGFLAGS_NM TEXT("DBGFLAGS")
  55. #endif
  56. #define WINSCNF_FILTER1BREQUESTS_NM TEXT("Filter1BRequests")
  57. #define WINSCNF_ADD1BTO1CQUERIES_NM TEXT("Prepend1BTo1CQueries")
  58. #define WINSCNF_LOG_DETAILED_EVTS_NM TEXT("LogDetailedEvents")
  59. #define WINSCNF_REFRESH_INTVL_NM TEXT("RefreshInterval")
  60. #define WINSCNF_INIT_CHL_RETRY_INTVL_NM TEXT("InitChlRetryInterval")
  61. #define WINSCNF_CHL_MAX_RETRIES_NM TEXT("ChlMaxNoOfRetries")
  62. #define WINSCNF_TOMBSTONE_INTVL_NM TEXT("TombstoneInterval")
  63. #define WINSCNF_TOMBSTONE_TMOUT_NM TEXT("TombstoneTimeout")
  64. #define WINSCNF_VERIFY_INTVL_NM TEXT("VerifyInterval")
  65. #define WINSCNF_DB_FILE_NM TEXT("DbFileNm")
  66. #define WINSCNF_DB_FILE_NM_ASCII "DbFileNm"
  67. #define WINSCNF_STATIC_INIT_FLAG_NM TEXT("DoStaticDataInit")
  68. #define WINSCNF_INIT_VERSNO_VAL_LW_NM TEXT("VersCounterStartVal_LowWord")
  69. #define WINSCNF_INIT_VERSNO_VAL_HW_NM TEXT("VersCounterStartVal_HighWord")
  70. #define WINSCNF_BACKUP_DIR_PATH_NM TEXT("BackupDirPath")
  71. #define WINSCNF_PRIORITY_CLASS_HIGH_NM TEXT("PriorityClassHigh")
  72. #define WINSCNF_MAX_NO_WRK_THDS_NM TEXT("NoOfWrkThds")
  73. #define WINSCNF_INIT_TIME_PAUSE_NM TEXT("InitTimePause")
  74. #define WINSCNF_CLUSTER_RESOURCE_NM TEXT( "ClusterResourceName")
  75. //
  76. // To allow WINS to revert back to 351 jet and db
  77. //
  78. #define WINSCNF_USE_351DB_NM TEXT("Use351Db")
  79. #define WINSCNF_USE_4DB_NM TEXT("Use4Db")
  80. #if MCAST > 0
  81. #define WINSCNF_USE_SELF_FND_PNRS_NM TEXT("UseSelfFndPnrs")
  82. #define WINSCNF_SELF_FND_NM TEXT("SelfFnd")
  83. #define WINSCNF_MCAST_TTL_NM TEXT("McastTtl")
  84. #define WINSCNF_MCAST_INTVL_NM TEXT("McastIntvl")
  85. #endif
  86. #define WINSCNF_WINS_PORT_NO_NM TEXT("PortNo")
  87. // persona grata/non-grata registry names have to be ASCII. The registry is queried
  88. // through RegQueryValueExA() calls (see GetOwnerList() from winscnf.c)
  89. #define PERSMODE_NON_GRATA 0
  90. #define PERSMODE_GRATA 1
  91. #define WINSCNF_PERSONA_MODE_NM "PersonaMode"
  92. #define WINSCNF_PERSONA_NON_GRATA_NM "PersonaNonGrata"
  93. #define WINSCNF_PERSONA_GRATA_NM "PersonaGrata"
  94. #if PRSCONN
  95. #define WINSCNF_PRS_CONN_NM TEXT("PersistentRplOn")
  96. #endif
  97. //
  98. // Spoof reg/ref
  99. //
  100. #define WINSCNF_BURST_HANDLING_NM TEXT("BurstHandling")
  101. #define WINSCNF_BURST_QUE_SIZE_NM TEXT("BurstQueSize")
  102. // to enable round-robin list of 1C member addresses
  103. #define WINSCNF_RANDOMIZE_1C_LIST_NM TEXT("Randomize1CList")
  104. //
  105. // NOTE NOTE NOTE
  106. //
  107. // This should never be set to FALSE in the registry unless we notice
  108. // a major bug in WINS that is resulting in replication to stop. This
  109. // parameter is a hatch door at best to get around an insidious bug
  110. // that may escape us during our testing -- Good insurance policy
  111. //
  112. #define WINSCNF_NO_RPL_ON_ERR_NM TEXT("NoRplOnErr")
  113. //
  114. // FUTURES - remove when JetBackup is internationalized. Also, update
  115. // WinsCnfReadWinsInfo.
  116. //
  117. #define WINSCNF_ASCII_BACKUP_DIR_PATH_NM "BackupDirPath"
  118. #define WINSCNF_INT_VERSNO_NEXTTIME_LW_NM TEXT("WinsInternalVersNoNextTime_LW")
  119. #define WINSCNF_INT_VERSNO_NEXTTIME_HW_NM TEXT("WinsInternalVersNoNextTime_HW")
  120. #define WINSCNF_DO_BACKUP_ON_TERM_NM TEXT("DoBackupOnTerm")
  121. #define WINSCNF_MIGRATION_ON_NM TEXT("MigrateOn")
  122. #define WINSCNF_REG_QUE_MAX_LEN_NM TEXT("RegQueMaxLen")
  123. //
  124. // Names to use in the registry for values of the PUSH/PULL sub-keys
  125. //
  126. #define WINSCNF_ADDCHG_TRIGGER_NM TEXT("RplOnAddressChg")
  127. #define WINSCNF_RETRY_COUNT_NM TEXT("CommRetryCount")
  128. //
  129. // Under IP address of a Push pnr
  130. //
  131. #define WINSCNF_SP_TIME_NM TEXT("SpTime")
  132. #define WINSCNF_RPL_INTERVAL_NM TEXT("TimeInterval")
  133. #define WINSCNF_MEMBER_PREC_NM TEXT("MemberPrecedence")
  134. //
  135. // Under IP address of a Pull pnr
  136. //
  137. #define WINSCNF_UPDATE_COUNT_NM TEXT("UpdateCount")
  138. //
  139. // Both pull/push pnr
  140. //
  141. #define WINSCNF_ONLY_DYN_RECS_NM TEXT("OnlyDynRecs")
  142. //
  143. // Value of the PULL/PUSH key
  144. //
  145. #define WINSCNF_INIT_TIME_RPL_NM TEXT("InitTimeReplication")
  146. //
  147. // Value of the PUSH key
  148. //
  149. #define WINSCNF_PROP_NET_UPD_NTF TEXT("PropNetUpdNtf")
  150. //
  151. // Indicate whether propagation is to be done or not
  152. //
  153. #define DO_PROP_NET_UPD_NTF TRUE
  154. #define DONT_PROP_NET_UPD_NTF FALSE
  155. //
  156. // if "OnlyWithCnfPnrs" is set to TRUE, replication will be performed only
  157. // with those partners that are listed under the Pull/Push key. If not
  158. // set to TRUE, replication can be initiated even with unlisted partners
  159. // as a result of administrative action or as a result of receiving an
  160. // update notification
  161. //
  162. #define WINSCNF_RPL_ONLY_W_CNF_PNRS_NM TEXT("RplOnlyWCnfPnrs")
  163. //
  164. // This DWORD can be under the Partners, Partners\Pull,
  165. // Partners\Push keys or under a partner's ip address key. If it is in more
  166. // than in one place in the key heirarchy, the lower one overrides the upper
  167. // one.
  168. //
  169. // Each bit indicates the kind of replication we want/don't want.
  170. // If no bit is set or if this parameter is not defined, it means
  171. // replicate everything (unless WINSCNF_ONLY_DYN_RECS_NM is defined - ideally
  172. // that should be represented by a bit in this DWORD but that is river under
  173. // the bridge and I don't want to get rid of that parameter since folks are
  174. // used to it, it being in the doc set and all). Currently the following is
  175. // defined
  176. //
  177. // All replication under the constraint of WINSCNF_ONLY_DYN_RECS_NM if defined
  178. //
  179. #define WINSCNF_RPL_DEFAULT_TYPE 0x0
  180. //
  181. // LSB - Replicate only the special group names (special groups - domains and
  182. // user defined special groups)
  183. //
  184. #define WINSCNF_RPL_SPEC_GRPS_N_PDC 0x1
  185. #define WINSCNF_RPL_ONLY_DYN_RECS 0x80000000
  186. #define WINSCNF_RPL_TYPE_NM TEXT("ReplicationType")
  187. //
  188. // Path to log file
  189. //
  190. #define WINSCNF_LOG_FLAG_NM TEXT("LoggingOn")
  191. #define WINSCNF_LOG_FILE_PATH_NM TEXT("LogFilePath")
  192. #define WINSCNF_MAX_CHL_RETRIES 3 //max. # of retries RFC 1002
  193. //page 83
  194. #if 0
  195. #define WINSCNF_CHL_RETRY_INTERVAL 250 //Time interval (in msecs)
  196. //between retries -- RFC 1002
  197. //page 83
  198. #endif
  199. #define WINSCNF_CHL_RETRY_INTERVAL 500 //Time interval (in msecs)
  200. #define WINSCNF_PROC_HIGH_PRIORITY_CLASS HIGH_PRIORITY_CLASS
  201. #define WINSCNF_PROC_PRIORITY_CLASS NORMAL_PRIORITY_CLASS
  202. #define WINSCNF_SCV_PRIORITY_LVL THREAD_PRIORITY_BELOW_NORMAL
  203. //
  204. // The Retry timeout is kept as 10 secs. It will be typically << the time
  205. // interval for replication, allowing us to retry a number of times
  206. // prior to the next replication cycle.
  207. //
  208. //
  209. // The Retry Time Interval is not used presently. We are using the
  210. // replication time interval for retries. This makes things simpler
  211. //
  212. #define WINSCNF_RETRY_TIME_INT 10 //time interval for retries
  213. //if there is a comm failure
  214. #define WINSCNF_MAX_COMM_RETRIES 3 //max. number of retries before
  215. //giving up trying to set up
  216. //communications with a WINS
  217. //
  218. // Precedence of remote members (of special groups) registered by a WINS
  219. // relative to the same registered by other WINS servers (used during
  220. // pull replication)
  221. //
  222. // Locally registered members always have high precedence
  223. //
  224. // Make sure that WINSCNF_LOW_PREC < WINSCNF_HIGH_PREC (this fact is used in
  225. // nmsnmh.c- UnionGrps())
  226. //
  227. //
  228. #define WINSCNF_LOW_PREC 0
  229. #define WINSCNF_HIGH_PREC 1
  230. //
  231. // After replication with a WINS has stopped because of persistent
  232. // communication failure (i.e. after all retries have been exhausted),
  233. // WINS will wait until the following number of replication time intervals
  234. // have elapsed before starting the retries again. If replication
  235. // got stopped with more than one WINS partner with the same time interval
  236. // (for pulling from it), then retry will be done for all these WINS when
  237. // it is done for one (in other words, resumption of replication for a WINS
  238. // may happen sooner than you think).
  239. //
  240. // We need to keep this number at least 2 since if we have not been able to
  241. // communicate with the WINS server for WINSCNF_MAX_COMM_RETRIES times
  242. // in the past WINSCNF_MAX_COMM_RETRIES * replication interval for the WINS,
  243. // then it is highly probable that the WINS server is down for good. We
  244. // retry again after the 'backoff' time. Hopefully, by then the admin would
  245. // have corrected the problem. Now, it is possible (unlikely though) that
  246. // the WINS server happened to be down only at the times this WINS tried to
  247. // contact it. We have no way to determine that.
  248. //
  249. //
  250. // This can be made a registry parameter. This can be called the sleep time
  251. // between successive rounds of retries.
  252. //
  253. #define WINSCNF_RETRY_AFTER_THIS_MANY_RPL 2
  254. //
  255. // if the time interval for periodic replication with a partner with which
  256. // a WINS server has had consecutive comm. failures is more than the
  257. // following amount, we don't back off as explained above
  258. //
  259. //
  260. #define WINSCNF_MAX_WAIT_BEFORE_RETRY_RPL ONEDAY //1 day
  261. //
  262. // The max. number of comcurrent static initializations that can be
  263. // happening. These may be due to commands from the admin. tool or
  264. // due to registry notifications.
  265. //
  266. #define WINSCNF_MAX_CNCRNT_STATIC_INITS 3
  267. //
  268. // No of records to handle at one time (used by the scavenger thread). This
  269. // number determines the size of the memory block that will be allocated
  270. // by NmsDbGetDataRecs().
  271. //
  272. //#define WINSCNF_SCV_CHUNK 1000
  273. #define WINSCNF_SCV_CHUNK 3000
  274. //
  275. // defines
  276. //
  277. //
  278. // Refresh interval - time period after which the state of an ACTIVE entry in
  279. // the db is set to NMSDB_E_RELEASED if it has not
  280. // been refreshed
  281. //
  282. #define WINSCNF_MIN_REFRESH_INTERVAL FORTY_MTS
  283. #define WINSCNF_DEF_REFRESH_INTERVAL SIX_DAYS //FOUR_DAYS
  284. #define REF_MULTIPLIER_FOR_ACTIVE 2
  285. //
  286. // The Tombstone Interval (the interval a record stays released) should be
  287. // a multiple of the RefreshInterval by at least the following amount
  288. //
  289. // With 2 as the value and refresh time interval being 4 days, TombInterval
  290. // is max(8 days, 2 * MaxRplInterval) i.e at least 8 days.
  291. //
  292. #define REF_MULTIPLIER_FOR_TOMB 2
  293. //
  294. // Challenge Retry interval
  295. //
  296. #define WINSCNF_MIN_INIT_CHL_RETRY_INTVL 250
  297. #define WINSCNF_DEF_INIT_CHL_RETRY_INTVL 500
  298. //
  299. // Challenge Max. No. of Retries
  300. //
  301. #define WINSCNF_MIN_CHL_MAX_RETRIES 1
  302. #define WINSCNF_DEF_CHL_MAX_RETRIES 3
  303. //
  304. // Also the min. tombstone timeout should be
  305. // max(RefreshInterval, RPL_MULTIPLIER_FOR_TOMBTMOUT * MaxRplInterval)
  306. //
  307. // With Refresh Interval being 4 days, this will be atleast 4 days.
  308. //
  309. #define RPL_MULTIPLIER_FOR_TOMBTMOUT 4
  310. //
  311. // The verify interval should be a multiple of the tombstone time
  312. // interval by at least the following amount. Keep the total time high
  313. //
  314. // With with the min. tombstone interval being at least 8 days, it will be at
  315. // least (3 * 8 = 24 days)
  316. //
  317. #define TOMB_MULTIPLIER_FOR_VERIFY 3
  318. //
  319. // Tombstone interval - time period after which the state of a released
  320. // entry is changed to NMSDB_E_TOMBSTONE if it has not
  321. // been refreshed
  322. //
  323. #define WINSCNF_MIN_TOMBSTONE_INTERVAL (WINSCNF_MIN_REFRESH_INTERVAL * REF_MULTIPLIER_FOR_TOMB)
  324. //
  325. // Time period after which the tombstone should be deleted. The min. value
  326. // is 1 days. This is to cut down on the possibility of a
  327. // tombstone getting deleted prior to it getting replicated to another WINS.
  328. //
  329. #define WINSCNF_MIN_TOMBSTONE_TIMEOUT max(WINSCNF_MIN_REFRESH_INTERVAL, ONEDAY)
  330. //
  331. // Minimum time period for doing verifications of the replicas in the db
  332. //
  333. // Should be atleast 24 days.
  334. //
  335. #define WINSCNF_MIN_VERIFY_INTERVAL max(TWENTY_FOUR_DAYS, (WINSCNF_MIN_TOMBSTONE_INTERVAL * TOMB_MULTIPLIER_FOR_VERIFY))
  336. #define WINSCNF_CC_INTVL_NM TEXT("TimeInterval")
  337. #define WINSCNF_CC_MAX_RECS_AAT_NM TEXT("MaxRecsAtATime")
  338. #define WINSCNF_CC_USE_RPL_PNRS_NM TEXT("UseRplPnrs")
  339. #define WINSCNF_CC_DEF_INTERVAL ONEDAY
  340. #define WINSCNF_CC_MIN_INTERVAL (ONEDAY/4)
  341. #define WINSCNF_DEF_CC_SP_HR 2 //02 hrs - 2am
  342. #define WINSCNF_CC_MIN_RECS_AAT 1000
  343. #define WINSCNF_CC_DEF_RECS_AAT 30000
  344. #define WINSCNF_CC_DEF_USE_RPL_PNRS 0
  345. #if 0
  346. //
  347. // Make the refresh interval equal to twice the max. replication time interval
  348. // if that is greater than the refresh interval.
  349. //
  350. #define WINSCNF_MAKE_REF_INTVL_M(RefreshInterval, MaxRplIntvl) max(REF_MULTIPLIER_FOR_ACTIVE * (MaxRplIntvl), RefreshInterval)
  351. #endif
  352. //
  353. // The Tombstone interval should never be allowed to go over 4 days. We
  354. // don't want a record to remain released for longer than that. It should
  355. // turn into a tombstone so that it gets replicated.
  356. //
  357. // The reason we change the state of a record to released is to avoid
  358. // replication if the reason for the release is a temporary shutdown of
  359. // the pc. We have to consider a long weekend (3 days). We however
  360. // also need to consider the fact that if the refresh interval is 40 mts or
  361. // some such low value, then we should not keep the record in the released
  362. // state for more than a day at the most. Consider a situation where
  363. // a node registers with the backup because the primary is down and then
  364. // goes back to the primary when it comes up. The primary does not
  365. // increment the version number because the record is stil active. The
  366. // record gets released at the backup and stays that way until it becomes
  367. // a tombstone which results in replication and the backup again getting
  368. // the active record from the primary. For the above situaion, we should
  369. // make sure of two things: first - the record does not have an overly large
  370. // tombstone interval; second - the replication time interval is small. We
  371. // don't want to change the replication time interval set by the admin. but
  372. // we can do something about the former.
  373. //
  374. // As long as the user sticks with the default refresh interval, the tombstone
  375. // interval will be the same as that.
  376. //
  377. // For the case where the user specifies a different refresh interval, we use
  378. // a max. of the refresh interval and a multiple of the max. rpl. interval.
  379. //
  380. //
  381. #define WINSCNF_MAKE_TOMB_INTVL_M(RefreshInterval, MaxRplIntvl) min(max(REF_MULTIPLIER_FOR_TOMB * (MaxRplIntvl), RefreshInterval), FOUR_DAYS)
  382. #define WINSCNF_MAKE_TOMB_INTVL_0_M(RefreshInterval) min(RefreshInterval, FOUR_DAYS)
  383. //
  384. // macro to get the minimum tombstone timeout based on the maximum replication
  385. // time interval.
  386. //
  387. #define WINSCNF_MAKE_TOMBTMOUT_INTVL_M(MaxRplIntvl) max(WINSCNF_MIN_TOMBSTONE_TIMEOUT,(RPL_MULTIPLIER_FOR_TOMBTMOUT * (MaxRplIntvl)))
  388. //
  389. // Macro to get the minimum verify interval based on tombstone interval
  390. //
  391. // Should be atleast 8 days.
  392. //
  393. #define WINSCNF_MAKE_VERIFY_INTVL_M(TombstoneInterval) max(TWENTY_FOUR_DAYS, (TOMB_MULTIPLIER_FOR_VERIFY * (TombstoneInterval)))
  394. //
  395. // Min. Mcast TTL
  396. //
  397. #define WINSCNF_MIN_MCAST_TTL TTL_SUBNET_ONLY
  398. #define WINSCNF_DEF_MCAST_TTL TTL_REASONABLE_REACH
  399. #define WINSCNF_MAX_MCAST_TTL 32
  400. #define WINSCNF_MIN_MCAST_INTVL FORTY_MTS
  401. #define WINSCNF_DEF_MCAST_INTVL FORTY_MTS
  402. #define WINS_QUEUE_HWM 500
  403. #define WINS_QUEUE_HWM_MAX 5000
  404. #define WINS_QUEUE_HWM_MIN 50
  405. #endif _WINSCNST_H_
  406.