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.

520 lines
13 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. //
  5. // Copyright (C) Microsoft Corporation, 1998 - 1999
  6. //
  7. // File: serverui.h
  8. //
  9. //--------------------------------------------------------------------------
  10. #ifndef _SERVERUI_H
  11. #define _SERVERUI_H
  12. #include "uiutil.h"
  13. #include "ipeditor.h"
  14. #include "nspage.h"
  15. #include "aclpage.h"
  16. ///////////////////////////////////////////////////////////////////////////////
  17. // FORWARD DECLARATIONS
  18. class CDNSServerNode;
  19. ///////////////////////////////////////////////////////////////////////////////
  20. // CDNSServer_InterfacesPropertyPage
  21. class CDNSServer_InterfacesPropertyPage : public CPropertyPageBase
  22. {
  23. // Construction
  24. public:
  25. CDNSServer_InterfacesPropertyPage();
  26. // Implementation
  27. protected:
  28. // Generated message map functions
  29. virtual BOOL OnInitDialog();
  30. virtual BOOL OnApply();
  31. afx_msg void OnListenOnSpecifiedAddresses();
  32. afx_msg void OnListenOnAllAddresses();
  33. private:
  34. class CListenAddressesIPEditor : public CIPEditor
  35. {
  36. public:
  37. CListenAddressesIPEditor() : CIPEditor(TRUE) {}
  38. virtual void OnChangeData();
  39. };
  40. CListenAddressesIPEditor m_listenAddressesEditor;
  41. CButton* GetListenOnAllRadio()
  42. { return (CButton*)GetDlgItem(IDC_LISTEN_ON_ALL_RADIO);}
  43. CButton* GetListenOnSpecifiedRadio()
  44. { return (CButton*)GetDlgItem(IDC_LISTEN_ON_SPECIFIED_RADIO);}
  45. void SelectionHelper(BOOL bListenAll);
  46. friend class CListenAddressesIPEditor;
  47. BOOL m_bAllWasPreviousSelection;
  48. DECLARE_MESSAGE_MAP()
  49. };
  50. ///////////////////////////////////////////////////////////////////////////////
  51. // CDNSServer_ForwardersPropertyPage
  52. class CDNSServer_ForwardersPropertyPage : public CPropertyPageBase
  53. {
  54. // Construction
  55. public:
  56. CDNSServer_ForwardersPropertyPage();
  57. // Implementation
  58. protected:
  59. afx_msg void OnForwardersCheck();
  60. afx_msg void OnSlaveCheckChange();
  61. afx_msg void OnForwarderTimeoutChange();
  62. virtual BOOL OnInitDialog();
  63. virtual BOOL OnApply();
  64. virtual BOOL OnKillActive();
  65. private:
  66. void EnableForwardersUI(BOOL bUseForwaders);
  67. CButton* GetForwardersCheck() { return (CButton*)GetDlgItem(IDC_USE_FORWARDERS_CHECK);}
  68. CButton* GetSlaveCheck() { return (CButton*)GetDlgItem(IDC_SLAVE_CHECK);}
  69. CStatic* GetForwardersStatic() { return (CStatic*)GetDlgItem(IDC_STATIC_ADD_FORWARDERS);}
  70. CDNSUnsignedIntEdit m_forwardTimeoutEdit;
  71. class CForwarderAddressesIPEditor : public CIPEditor
  72. {
  73. public:
  74. virtual void OnChangeData();
  75. };
  76. CForwarderAddressesIPEditor m_forwarderAddressesEditor;
  77. friend class CForwarderAddressesIPEditor;
  78. DECLARE_MESSAGE_MAP()
  79. };
  80. ///////////////////////////////////////////////////////////////////////////////
  81. // CAllOthersDomainInfo
  82. class CAllOthersDomainInfo
  83. {
  84. public:
  85. CAllOthersDomainInfo(DWORD cAddrCount, PIP_ADDRESS pipAddrs, DWORD dwForwardTimeout, DWORD fSlave)
  86. {
  87. m_cAddrCount = cAddrCount;
  88. m_pipAddrs = pipAddrs;
  89. m_dwForwardTimeout = dwForwardTimeout;
  90. m_fSlave = fSlave;
  91. }
  92. DWORD m_cAddrCount;
  93. PIP_ADDRESS m_pipAddrs;
  94. DWORD m_dwForwardTimeout;
  95. DWORD m_fSlave;
  96. };
  97. ///////////////////////////////////////////////////////////////////////////////
  98. // CDomainForwardersEditInfo
  99. class CDomainForwardersEditInfo
  100. {
  101. public:
  102. CDomainForwardersEditInfo(CDNSZoneNode* pZoneNode, BOOL bADIntegrated, BOOL bAllOthers = FALSE);
  103. ~CDomainForwardersEditInfo();
  104. typedef enum
  105. {
  106. nochange = 0,
  107. update,
  108. add,
  109. remove
  110. } ACTION_ITEM;
  111. void SetAllOthersDomain(CAllOthersDomainInfo* pAllOthers);
  112. BOOL IsAllOthers() { return m_bAllOthersDomain; }
  113. void SetAction(ACTION_ITEM action);
  114. ACTION_ITEM GetAction() { return m_actionItem; }
  115. void SetSlave(BOOL bSlave) { m_bSlave = bSlave; }
  116. BOOL IsSlave() { return m_bSlave; }
  117. void SetTimeout(DWORD dwTimeout) { m_dwTimeout = dwTimeout; }
  118. DWORD GetTimeout() { return m_dwTimeout; }
  119. BOOL IsADIntegrated() { return m_bADIntegrated; }
  120. void SetIPList(DWORD dwCount, PIP_ADDRESS pipArray)
  121. {
  122. m_cAddrCount = dwCount;
  123. m_pIPList = pipArray;
  124. }
  125. PIP_ADDRESS GetIPList(DWORD* pdwCount)
  126. {
  127. *pdwCount = m_cAddrCount;
  128. return m_pIPList;
  129. }
  130. void SetDomainName(PCWSTR pszDomainName) { m_szDomainName = pszDomainName; }
  131. void GetDomainName(CString& szDomainName) { szDomainName = m_szDomainName; }
  132. void SetDataFromRPC(BOOL bRPCData) { m_bRPCData = bRPCData; }
  133. BOOL IsDataFromRPC() { return m_bRPCData; }
  134. BOOL Update(BOOL bSlave, DWORD dwTimeout, DWORD dwCount, PIP_ADDRESS pipArray);
  135. CDNSZoneNode* GetZoneNode() { return m_pZoneNode; }
  136. private:
  137. BOOL m_bADIntegrated;
  138. BOOL m_bAllOthersDomain;
  139. ACTION_ITEM m_actionItem;
  140. CDNSZoneNode* m_pZoneNode;
  141. CAllOthersDomainInfo* m_pAllOthers;
  142. BOOL m_bRPCData;
  143. CString m_szDomainName;
  144. BOOL m_bSlave;
  145. DWORD m_dwTimeout;
  146. DWORD m_cAddrCount;
  147. PIP_ADDRESS m_pIPList;
  148. };
  149. ///////////////////////////////////////////////////////////////////////////////
  150. // CDomainForwardersEditList
  151. class CDomainForwardersEditList : public CList<CDomainForwardersEditInfo*, CDomainForwardersEditInfo*>
  152. {
  153. public:
  154. ~CDomainForwardersEditList()
  155. {
  156. DeleteAll();
  157. }
  158. void DeleteAll()
  159. {
  160. while (!IsEmpty())
  161. {
  162. delete RemoveTail();
  163. }
  164. }
  165. void Remove(CDomainForwardersEditInfo* pInfo)
  166. {
  167. POSITION pos = GetHeadPosition();
  168. while (pos != NULL)
  169. {
  170. CDomainForwardersEditInfo* pListInfo = reinterpret_cast<CDomainForwardersEditInfo*>(GetAt(pos));
  171. if (pListInfo == pInfo)
  172. {
  173. RemoveAt(pos);
  174. break;
  175. }
  176. GetNext(pos);
  177. }
  178. }
  179. CDomainForwardersEditInfo* DoesExist(PCWSTR pszDomainName)
  180. {
  181. POSITION pos = GetHeadPosition();
  182. while (pos != NULL)
  183. {
  184. CDomainForwardersEditInfo* pListInfo = reinterpret_cast<CDomainForwardersEditInfo*>(GetNext(pos));
  185. if (pListInfo != NULL)
  186. {
  187. CString szName;
  188. pListInfo->GetDomainName(szName);
  189. if (szName == pszDomainName)
  190. {
  191. return pListInfo;
  192. }
  193. }
  194. }
  195. return NULL;
  196. }
  197. };
  198. ///////////////////////////////////////////////////////////////////////////////
  199. // CDNSServer_DomainForwardersPropertyPage
  200. class CDNSServer_DomainForwardersPropertyPage : public CPropertyPageBase
  201. {
  202. // Construction
  203. public:
  204. CDNSServer_DomainForwardersPropertyPage();
  205. // Implementation
  206. protected:
  207. afx_msg void OnDomainSelChange();
  208. afx_msg void OnAddDomain();
  209. afx_msg void OnRemoveDomain();
  210. afx_msg void OnSlaveCheckChange();
  211. afx_msg void OnForwarderTimeoutChange();
  212. virtual BOOL OnInitDialog();
  213. virtual BOOL OnApply();
  214. virtual BOOL OnSetActive();
  215. private:
  216. CButton* GetSlaveCheck() { return (CButton*)GetDlgItem(IDC_SLAVE_CHECK);}
  217. CStatic* GetForwardersStatic() { return (CStatic*)GetDlgItem(IDC_STATIC_ADD_FORWARDERS);}
  218. CDNSUnsignedIntEdit m_forwardTimeoutEdit;
  219. class CForwarderAddressesIPEditor : public CIPEditor
  220. {
  221. public:
  222. virtual void OnChangeData();
  223. };
  224. CForwarderAddressesIPEditor m_forwarderAddressesEditor;
  225. friend class CForwarderAddressesIPEditor;
  226. DECLARE_MESSAGE_MAP()
  227. private:
  228. CDomainForwardersEditList m_EditList;
  229. CDomainForwardersEditInfo* m_pCurrentInfo;
  230. BOOL m_bPostApply;
  231. };
  232. ///////////////////////////////////////////////////////////////////////////////
  233. // CDNSServer_AdvancedPropertyPage
  234. class CDNSServer_AdvancedPropertyPage : public CPropertyPageBase
  235. {
  236. // Construction
  237. public:
  238. CDNSServer_AdvancedPropertyPage();
  239. virtual void SetDirty(BOOL bDirty) { CPropertyPageBase::SetDirty(bDirty); }
  240. // Implementation
  241. protected:
  242. afx_msg void OnAdvancedOptionsListChange() { SetDirty(TRUE);}
  243. afx_msg void OnComboSelChange() { SetDirty(TRUE);}
  244. afx_msg void OnResetButton();
  245. afx_msg void OnEnableScavenging();
  246. // Overrides
  247. protected:
  248. // Implementation
  249. protected:
  250. virtual void SetUIData();
  251. // Generated message map functions
  252. virtual BOOL OnInitDialog();
  253. virtual BOOL OnApply();
  254. private:
  255. CArrayCheckListBox m_advancedOptionsListBox;
  256. // set/get helpers
  257. void SetAdvancedOptionsListbox(BOOL* bRegKeyOptionsArr);
  258. void GetAdvancedOptionsListbox(BOOL* RegKeyOptionsArr);
  259. void SetBootMethodComboVal(UCHAR fBootMethod);
  260. UCHAR GetBootMethodComboVal();
  261. void SetNameCheckingComboVal(DWORD dwNameChecking);
  262. DWORD GetNameCheckingComboVal();
  263. CComboBox* GetNameCheckingCombo()
  264. { return (CComboBox*)GetDlgItem(IDC_NAME_CHECKING_COMBO);}
  265. CComboBox* GetBootMethodCombo()
  266. { return (CComboBox*)GetDlgItem(IDC_BOOT_METHOD_COMBO);}
  267. DECLARE_MESSAGE_MAP()
  268. CDNS_SERVER_AGING_TimeIntervalEditGroup m_scavengingIntervalEditGroup;
  269. };
  270. ///////////////////////////////////////////////////////////////////////////////
  271. // CDNSServer_DebugLoggingPropertyPage
  272. class CDNSServer_DebugLoggingPropertyPage : public CPropertyPageBase
  273. {
  274. // Construction
  275. public:
  276. CDNSServer_DebugLoggingPropertyPage();
  277. ~CDNSServer_DebugLoggingPropertyPage();
  278. // Implementation
  279. protected:
  280. // Overrides
  281. protected:
  282. afx_msg void OnLoggingCheck();
  283. afx_msg void OnSendCheck();
  284. afx_msg void OnReceiveCheck();
  285. afx_msg void OnQueriesCheck();
  286. afx_msg void OnNotifiesCheck();
  287. afx_msg void OnUpdatesCheck();
  288. afx_msg void OnRequestCheck();
  289. afx_msg void OnResponseCheck();
  290. afx_msg void OnUDPCheck();
  291. afx_msg void OnTCPCheck();
  292. afx_msg void OnDetailCheck();
  293. afx_msg void OnFilterCheck();
  294. afx_msg void OnFilterButton();
  295. afx_msg void OnLogFileChange();
  296. afx_msg void OnMaxSizeChange();
  297. // Implementation
  298. protected:
  299. void EnableLogging(BOOL bLogging = TRUE);
  300. void ResetToDefaults();
  301. void SetUIFromOptions(DWORD dwOptions);
  302. void SetOptionsDirty(BOOL bDirty = TRUE);
  303. BOOL AreOptionsDirty();
  304. virtual void SetUIData();
  305. virtual void GetUIData(BOOL bSilent = TRUE);
  306. // Generated message map functions
  307. virtual BOOL OnInitDialog();
  308. virtual BOOL OnApply();
  309. private:
  310. DWORD m_dwLogLevel;
  311. DWORD m_dwMaxSize;
  312. CString m_szLogFileName;
  313. PIP_ARRAY m_pIPFilterList;
  314. BOOL m_bOnSetUIData;
  315. BOOL m_bMaxSizeDirty;
  316. BOOL m_bLogFileDirty;
  317. BOOL m_bFilterDirty;
  318. BOOL m_bOwnIPListMemory;
  319. BOOL m_bNotWhistler;
  320. BOOL m_bOptionsDirty;
  321. DECLARE_MESSAGE_MAP()
  322. };
  323. ///////////////////////////////////////////////////////////////////////////////
  324. // CDNSServer_EventLoggingPropertyPage
  325. class CDNSServer_EventLoggingPropertyPage : public CPropertyPageBase
  326. {
  327. // Construction
  328. public:
  329. CDNSServer_EventLoggingPropertyPage();
  330. // Implementation
  331. protected:
  332. afx_msg void OnSetDirty();
  333. // Overrides
  334. protected:
  335. // Implementation
  336. protected:
  337. virtual void SetUIData();
  338. // Generated message map functions
  339. virtual BOOL OnInitDialog();
  340. virtual BOOL OnApply();
  341. private:
  342. DWORD m_dwEventLogLevel;
  343. DECLARE_MESSAGE_MAP()
  344. };
  345. ///////////////////////////////////////////////////////////////////////////////
  346. // CDNSServer_CopyRootHintsFromDialog
  347. class CDNSServer_CopyRootHintsFromDialog : public CHelpDialog
  348. {
  349. public:
  350. CDNSServer_CopyRootHintsFromDialog(CComponentDataObject* pComponentData);
  351. virtual void OnOK();
  352. afx_msg void OnIPv4CtrlChange();
  353. DWORD m_dwIPVal;
  354. protected:
  355. CDNSIPv4Control* GetIPv4Ctrl() { return (CDNSIPv4Control*)GetDlgItem(IDC_IPEDIT);}
  356. CComponentDataObject* m_pComponentData;
  357. DECLARE_MESSAGE_MAP()
  358. };
  359. ///////////////////////////////////////////////////////////////////////////////
  360. // CDNSServer_RootHintsPropertyPage
  361. class CDNSServer_RootHintsPropertyPage : public CDNSNameServersPropertyPage
  362. {
  363. public:
  364. CDNSServer_RootHintsPropertyPage();
  365. virtual BOOL OnInitDialog();
  366. virtual BOOL OnApply();
  367. afx_msg void OnCopyFrom();
  368. protected:
  369. virtual void ReadRecordNodesList();
  370. virtual BOOL WriteNSRecordNodesList();
  371. void AddCopiedRootHintsToList(PDNS_RECORD pRootHintsRecordList);
  372. DECLARE_MESSAGE_MAP()
  373. };
  374. #include "servmon.h"
  375. ///////////////////////////////////////////////////////////////////////////////
  376. // CDNSServerPropertyPageHolder
  377. // page holder to contain DNS Server property pages
  378. class CDNSServerPropertyPageHolder : public CPropertyPageHolderBase
  379. {
  380. public:
  381. CDNSServerPropertyPageHolder(CDNSRootData* pRootDataNode, CDNSServerNode* pServerNode,
  382. CComponentDataObject* pComponentData);
  383. ~CDNSServerPropertyPageHolder();
  384. CDNSServerNode* GetServerNode() { return (CDNSServerNode*)GetTreeNode();}
  385. protected:
  386. virtual void OnSheetMessage(WPARAM wParam, LPARAM lParam);
  387. virtual HRESULT OnAddPage(int nPage, CPropertyPageBase* pPage);
  388. virtual int OnSelectPageMessage(long nPageCode) { return nPageCode;}
  389. private:
  390. CDNSServer_InterfacesPropertyPage m_interfacesPage;
  391. CDNSServer_DomainForwardersPropertyPage m_newForwardersPage;
  392. CDNSServer_AdvancedPropertyPage m_advancedPage;
  393. CDNSServer_RootHintsPropertyPage m_rootHintsPage;
  394. CDNSServer_TestPropertyPage m_testPage;
  395. CDNSServer_DebugLoggingPropertyPage m_debugLoggingPage;
  396. CDNSServer_EventLoggingPropertyPage m_eventLoggingPage;
  397. // optional security page
  398. CAclEditorPage* m_pAclEditorPage;
  399. };
  400. #endif // _SERVERUI_H