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.

453 lines
14 KiB

  1. #ifndef _WINSCNF_
  2. #define _WINSCNF_
  3. #ifdef __cplusplus
  4. extern "C" {
  5. #endif
  6. /*++
  7. Copyright (c) 1989 Microsoft Corporation
  8. Module Name:
  9. nmscnf.c
  10. Abstract:
  11. This is the header file to be included for calling functions defined
  12. in nmscnf.c file.
  13. Functions:
  14. Portability:
  15. This header is portable.
  16. Author:
  17. Pradeep Bahl (PradeepB) Jan-1993
  18. Revision History:
  19. Modification Date Person Description of Modification
  20. ------------------ ------- ---------------------------
  21. --*/
  22. /*
  23. includes
  24. */
  25. #include "wins.h"
  26. #include "rpl.h"
  27. #include "winscnst.h"
  28. #if MCAST > 0
  29. #include "rnraddrs.h"
  30. #endif
  31. /*
  32. defines
  33. */
  34. /*
  35. macros
  36. */
  37. /*
  38. * externs
  39. */
  40. struct _WINSCNF_CNF_T; //forward declaration
  41. extern DWORD WinsCnfCnfMagicNo;
  42. extern struct _WINSCNF_CNF_T WinsCnf;
  43. extern BOOL fWinsCnfRplEnabled; //replication is enabled/disabled
  44. extern BOOL fWinsCnfScvEnabled; //scavenging is enabled/disabled
  45. extern BOOL fWinsCnfReadNextTimeVersNo; //set if vers. no. to use next time
  46. //is read in
  47. FUTURES("use #ifdef PERF around the following three perf. mon. vars")
  48. extern BOOL fWinsCnfPerfMonEnabled; //Perf Mon is enabled/disabled
  49. extern BOOL fWinsCnfHighResPerfCntr; //indicates whether the hardware
  50. //supports a high resolution
  51. //perf. counter
  52. extern LARGE_INTEGER LiWinsCnfPerfCntrFreq; //Performance Counter's Frequency
  53. extern CRITICAL_SECTION WinsCnfCnfCrtSec;
  54. extern TCHAR WinsCnfDb[WINS_MAX_FILENAME_SZ]; //db file to hold tables
  55. extern TCHAR WinsCnfStaticDataFile[WINS_MAX_FILENAME_SZ]; //file containing
  56. //static data used
  57. //to initialize WINS
  58. extern BOOL WinsCnfRegUpdThdExists;
  59. extern HANDLE WinsCnfNbtHandle;
  60. extern PTCHAR pWinsCnfNbtPath;
  61. extern BOOL fWinsCnfInitStatePaused;
  62. extern BOOL sfNoLimitChk; //to override the limit checks
  63. //
  64. // magic number of the Wins Cnf structure used at process invocation. This
  65. // WinsCnf structure is a global structure. When there is a reconfiguration
  66. // of WINS, we allocate a new WinsCnf structure and copy its contents to
  67. // the global WinsCnf structure. The magic number in the global WinsCnf is
  68. // incremented.
  69. //
  70. #define WINSCNF_INITIAL_CNF_MAGIC_NO 0
  71. #define WINSCNF_FILE_INFO_SZ sizeof(WINSCNF_DATAFILE_INFO_T)
  72. #define WINSCNF_SPEC_GRP_MASK_SZ 32
  73. /*
  74. typedef definitions
  75. */
  76. //
  77. // Action to take regarding whether the MemberPrec field of NMSDB_ADD_STATE_T
  78. // table should be set. Used in RplFindOwnerId (called by Pull Thread).
  79. //
  80. typedef enum _WINSCNF_INITP_ACTION_E {
  81. WINSCNF_E_INITP = 0,
  82. WINSCNF_E_INITP_IF_NON_EXISTENT,
  83. WINSCNF_E_IGNORE_PREC
  84. } WINSCNF_INITP_ACTION_E, *PWINSCNF_INITP_ACTION_E;
  85. //
  86. // This structure holds information about the file (name and type as
  87. // found in the registry (REG_SZ, REG_EXPAND_SZ) to be used for static
  88. // initialization of WINS
  89. //
  90. typedef struct _WINSCNF_DATAFILE_INFO_T{
  91. TCHAR FileNm[WINS_MAX_FILENAME_SZ];
  92. DWORD StrType;
  93. } WINSCNF_DATAFILE_INFO_T, *PWINSCNF_DATAFILE_INFO_T;
  94. //
  95. // used to index the array of handles specified to WinsMscWaitUntilSignaled
  96. // in nms.c
  97. //
  98. typedef enum _WINSCNF_HDL_SIGNALED_E {
  99. WINSCNF_E_TERM_HDL = 0,
  100. WINSCNF_E_WINS_HDL,
  101. WINSCNF_E_PARAMETERS_HDL,
  102. WINSCNF_E_PARTNERS_HDL,
  103. WINSCNF_E_NO_OF_HDLS_TO_MONITOR
  104. } WINSCNF_HDL_SIGNALED_E, *PWINSCNF_HDL_SIGNALED_E;
  105. //
  106. // The various keys in the WINS configuration (in registry)
  107. //
  108. //
  109. // Don't modify the following enum without looking at TypOfMon[] in winscnf.c
  110. // first
  111. //
  112. typedef enum _WINSCNF_KEY_E {
  113. WINSCNF_E_WINS_KEY = 0,
  114. WINSCNF_E_PARAMETERS_KEY,
  115. WINSCNF_E_SPEC_GRP_MASKS_KEY,
  116. WINSCNF_E_DATAFILES_KEY,
  117. WINSCNF_E_PARTNERS_KEY,
  118. WINSCNF_E_PULL_KEY,
  119. WINSCNF_E_PUSH_KEY,
  120. WINSCNF_E_ALL_KEYS
  121. } WINSCNF_KEY_E, *PWINSCNF_KEY_E;
  122. //
  123. // The states of a WINS
  124. //
  125. typedef enum _WINSCNF_STATE_E {
  126. WINSCNF_E_INITING = 0,
  127. WINSCNF_E_STEADY_STATE, //not used currently
  128. WINSCNF_E_STEADY_STATE_INITING, //not used currently
  129. WINSCNF_E_RUNNING,
  130. WINSCNF_E_INIT_TIME_PAUSE, //paused at initialization time as directed
  131. //via registry
  132. WINSCNF_E_PAUSED,
  133. WINSCNF_E_TERMINATING
  134. } WINSCNF_STATE_E, *PWINSCNF_STATE_E;
  135. //
  136. // Stores the special groups
  137. //
  138. typedef struct _WINSCNF_SPEC_GRP_MASKS_T {
  139. DWORD NoOfSpecGrpMasks;
  140. LPSTR pSpecGrpMasks;
  141. } WINSCNF_SPEC_GRP_MASKS_T, *PWINSCNF_SPEC_GRP_MASKS_T;
  142. typedef struct _WINSCNF_CC_T {
  143. DWORD TimeInt;
  144. BOOL fSpTime;
  145. DWORD SpTimeInt;
  146. DWORD MaxRecsAAT;
  147. BOOL fUseRplPnrs;
  148. } WINSCNF_CC_T, *PWINSCNF_CC_T;
  149. //
  150. // Stores the 1B names cache used in R_WinsGetBrowserNames
  151. //
  152. typedef struct _DOM_CACHE_T {
  153. DWORD NoOfUsers;
  154. HANDLE EvtHdl;
  155. DWORD EntriesRead;
  156. DWORD SzOfBlock;
  157. LPVOID pInfo;
  158. BOOL bRefresh;
  159. } DOM_CACHE_T;
  160. //
  161. // WINSCNF_CNF_T --
  162. // Holds all the configuration information about the WINS
  163. //
  164. typedef struct _WINSCNF_CNF_T {
  165. DWORD MagicNo; //Id.
  166. DWORD LogDetailedEvts; //log detailed events
  167. DWORD NoOfProcessors; // No of processors on the WINS machine
  168. DWORD NoOfDbBuffers; //No of buffers to specify to Jet
  169. WINSCNF_SPEC_GRP_MASKS_T SpecGrpMasks;
  170. WINSCNF_STATE_E State_e; //State
  171. DWORD RefreshInterval; //Refresh time interval
  172. DWORD TombstoneInterval; //Tombstone time interval
  173. DWORD TombstoneTimeout; //Tombstone timeout
  174. DWORD VerifyInterval; //Verify time interval
  175. DWORD ScvChunk; //# of records to handle at one
  176. //time by the scavenger thread
  177. DWORD MaxNoOfRetries; //Max # of retries for challenges
  178. DWORD RetryInterval; //Retry time interval
  179. LPBYTE pWinsDb; //db file name
  180. DWORD NoOfDataFiles; //no of files to use for static init
  181. PWINSCNF_DATAFILE_INFO_T pStaticDataFile;
  182. BOOL fStaticInit; //Do static initialization of WINS
  183. HANDLE WinsKChgEvtHdl; /*event to specify to
  184. *RegNotifyChangeKeyValue
  185. */
  186. HANDLE ParametersKChgEvtHdl; /*event to specify to
  187. *RegNotifyChangeKeyValue
  188. */
  189. HANDLE PartnersKChgEvtHdl; /*event to specify to
  190. *RegNotifyChangeKeyValue
  191. */
  192. HANDLE CnfChgEvtHdl; //Manual reset event to signal on
  193. //to notify other threads of config
  194. //change
  195. HANDLE LogHdl; /*
  196. * Handle to the WINS event log
  197. * Used by ReportEvent
  198. */
  199. DWORD WinsPriorityClass; //Priority class of the process
  200. DWORD MaxNoOfWrkThds; //Max. no. of worker thds.
  201. int ScvThdPriorityLvl;
  202. DWORD MaxRplTimeInterval; //max. rpl time interval
  203. BOOL fRplOnlyWCnfPnrs; //Rpl only with Pull/Push Pnrs
  204. BOOL fAdd1Bto1CQueries; //1B name should prepend responses to queries for 1C names
  205. #if MCAST > 0
  206. BOOL fUseSelfFndPnrs; //Rpl with Pnrs found by self
  207. DWORD McastTtl; // TTL for Mcast packets
  208. DWORD McastIntvl; // Time interval for mcast packets
  209. #endif
  210. BOOL fLoggingOn; //Turn on logging flag
  211. LPBYTE pLogFilePath; //Path to log file
  212. LPBYTE pBackupDirPath; //Path to backup directory
  213. BOOL fDoBackupOnTerm; //To turn on backup on termination
  214. BOOL fPStatic; //Set it TRUE to make static
  215. //records p-static
  216. BOOL fPersonaGrata; // TRUE/FALSE if pPersonaList is persona grata/non-grata
  217. DWORD NoOfPersona; // number of personas in the pPersonas
  218. PCOMM_ADD_T pPersonaList; // list of Personas
  219. DWORD RplType; //Rpl types (defined in winscnf.h)
  220. BOOL fNoRplOnErr; //stop rpl on error
  221. #if PRSCONN
  222. BOOL fPrsConn; //Prs Conn
  223. #endif
  224. WINSCNF_CC_T CC; //Consistency Chk
  225. BOOL fDoSpoofing;
  226. BOOL fRandomize1CList; // whether or not to randomize 1C list
  227. // list members.
  228. struct _PULL_T {
  229. DWORD MaxNoOfRetries; //no of retries to do in case
  230. //of comm. failure
  231. DWORD NoOfPushPnrs; //No of Push Pnrs
  232. PRPL_CONFIG_REC_T pPullCnfRecs; //ptr. to buff holding
  233. //cnf records for PULL
  234. //thd
  235. DWORD InitTimeRpl; // indicates whether
  236. // Replication
  237. //should be done at invocation
  238. DWORD RplType; //replication type
  239. #if PRSCONN
  240. BOOL fPrsConn;
  241. #endif
  242. BOOL fOnlyDynRecs; // when pulling from non-partners, pull only DynRecs
  243. } PullInfo;
  244. struct _PUSH_T {
  245. BOOL fAddChgTrigger; //trigger repl. on address chg
  246. //of entry owned by us
  247. DWORD NoOfPullPnrs; //No of Pull Pnrs
  248. DWORD NoPushRecsWValUpdCnt;
  249. PRPL_CONFIG_REC_T pPushCnfRecs; //ptr to buffer holding
  250. //cnf records for PUSH
  251. //thd
  252. DWORD InitTimePush; //indicates whether Push
  253. // notifications should
  254. //be sent at invocation
  255. BOOL PropNetUpdNtf; //set to TRUE if we want
  256. //net triggers to be
  257. //propagated
  258. DWORD RplType; //replication type
  259. #if PRSCONN
  260. BOOL fPrsConn;
  261. #endif
  262. BOOL fOnlyDynRecs; // when pushing records out to non-partners, push only DynRecs
  263. } PushInfo;
  264. } WINSCNF_CNF_T, *PWINSCNF_CNF_T;
  265. /*
  266. function declarations
  267. */
  268. #if USENETBT > 0
  269. extern
  270. STATUS
  271. WinsCnfReadNbtDeviceName(
  272. VOID
  273. );
  274. #endif
  275. extern
  276. STATUS
  277. WinsCnfInitConfig(
  278. VOID
  279. );
  280. extern
  281. VOID
  282. WinsCnfSetLastUpdCnt(
  283. PWINSCNF_CNF_T pWinsCnf
  284. );
  285. extern
  286. VOID
  287. WinsCnfReadRegInfo(
  288. PWINSCNF_CNF_T pWinsCnf
  289. );
  290. extern
  291. VOID
  292. WinsCnfCopyWinsCnf(
  293. WINS_CLIENT_E Client_e,
  294. PWINSCNF_CNF_T pSrc
  295. );
  296. extern
  297. LPVOID
  298. WinsCnfGetNextRplCnfRec(
  299. PRPL_CONFIG_REC_T pCnfRec,
  300. RPL_REC_TRAVERSAL_E RecTrv_e
  301. );
  302. extern
  303. VOID
  304. WinsCnfAskToBeNotified(
  305. WINSCNF_KEY_E Key_e
  306. );
  307. extern
  308. VOID
  309. WinsCnfDeallocCnfMem(
  310. PWINSCNF_CNF_T pWinsCnf
  311. );
  312. extern
  313. VOID
  314. WinsCnfReadWinsInfo(
  315. PWINSCNF_CNF_T pWinsCnf
  316. );
  317. extern
  318. VOID
  319. WinsCnfReadPartnerInfo(
  320. PWINSCNF_CNF_T pWinsCnf
  321. );
  322. extern
  323. VOID
  324. WinsCnfOpenSubKeys(
  325. VOID
  326. );
  327. extern
  328. VOID
  329. WinsCnfCloseKeys(
  330. VOID
  331. );
  332. extern
  333. VOID
  334. WinsCnfCloseSubKeys(
  335. VOID
  336. );
  337. extern
  338. STATUS
  339. WinsCnfGetNamesOfDataFiles(
  340. IN PWINSCNF_CNF_T pWinsCnf
  341. );
  342. extern
  343. DWORD
  344. WinsCnfWriteReg(
  345. LPVOID pTmp
  346. );
  347. extern
  348. STATUS
  349. WinsCnfInitLog(
  350. VOID
  351. );
  352. #if MCAST > 0
  353. extern
  354. STATUS
  355. WinsCnfAddPnr(
  356. RPL_RR_TYPE_E PnrType_e,
  357. LPBYTE pPnrAdd
  358. );
  359. extern
  360. STATUS
  361. WinsCnfDelPnr(
  362. RPL_RR_TYPE_E PnrType_e,
  363. LPBYTE pPnrAdd
  364. );
  365. #endif
  366. #ifdef DBGSVC
  367. extern
  368. VOID
  369. WinsCnfReadWinsDbgFlagValue(
  370. VOID
  371. );
  372. #endif
  373. #ifdef __cplusplus
  374. }
  375. #endif
  376. #endif //_WINSCNF_