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.

346 lines
9.1 KiB

  1. /**********************************************************************/
  2. /** Microsoft Windows/NT **/
  3. /** Copyright(c) Microsoft Corporation, 1998 - 1999 **/
  4. /**********************************************************************/
  5. /*
  6. radcfg.h
  7. Header file for RADIUS config obj.
  8. FILE HISTORY:
  9. */
  10. #include "resource.h" // main symbols
  11. #ifndef _DIALOG_H_
  12. #include "dialog.h"
  13. #endif
  14. #ifndef _RADBAL_H_
  15. #include "radbal.h"
  16. #endif
  17. /*---------------------------------------------------------------------------
  18. Class: RadiusServerDialog
  19. Class for the RADIUS authentication server dialog.
  20. ---------------------------------------------------------------------------*/
  21. class RadiusServerDialog : public CBaseDialog
  22. {
  23. public:
  24. RadiusServerDialog(BOOL fAuth, UINT idsTitle);
  25. ~RadiusServerDialog();
  26. void SetServer(LPCTSTR pszServerName);
  27. // Dialog Data
  28. //{{AFX_DATA(RadiusServerDialog)
  29. enum { IDD = IDD_RADIUS_AUTH };
  30. CListCtrl m_ListServers;
  31. //}}AFX_DATA
  32. // Overrides
  33. // ClassWizard generate virtual function overrides
  34. //{{AFX_VIRTUAL(RadiusServerDialog)
  35. public:
  36. virtual void OnOK();
  37. protected:
  38. virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
  39. //}}AFX_VIRTUAL
  40. // Implementation
  41. protected:
  42. // Generated message map functions
  43. //{{AFX_MSG(RadiusServerDialog)
  44. virtual BOOL OnInitDialog();
  45. afx_msg void OnBtnAdd();
  46. afx_msg void OnBtnEdit();
  47. afx_msg void OnBtnDelete();
  48. afx_msg void OnListDblClk(NMHDR *pNMHdr, LRESULT *pResult);
  49. afx_msg void OnNotifyListItemChanged(NMHDR *pNMHdr, LRESULT *pResult);
  50. // afx_msg void OnContextMenu(CWnd* pWnd, CPoint point);
  51. // afx_msg BOOL OnHelpInfo(HELPINFO* pHelpInfo);
  52. //}}AFX_MSG
  53. DECLARE_MESSAGE_MAP()
  54. private:
  55. CRadiusServers m_ServerList;
  56. // This is the other list (if this is the auth dlg, this is the acct list)
  57. // and vice versa. This is used to determine if a server's LSA entry
  58. // needs to be removed.
  59. CRadiusServers m_OtherServerList;
  60. CString m_stServerName;
  61. HKEY m_hkeyMachine;
  62. UINT m_idsTitle;
  63. BOOL m_fAuthDialog; // are we looking at auth or acct?
  64. };
  65. /*---------------------------------------------------------------------------
  66. Class: ServerPropDialog
  67. ---------------------------------------------------------------------------*/
  68. class ServerPropDialog : public CBaseDialog
  69. {
  70. // Construction
  71. public:
  72. ServerPropDialog(BOOL fEdit, CWnd* pParent = NULL); // standard constructor
  73. ~ServerPropDialog();
  74. protected:
  75. ServerPropDialog(BOOL fEdit, UINT idd, CWnd* pParent = NULL); // standard constructor
  76. public:
  77. VOID SetDefault(RADIUSSERVER *pServer);
  78. VOID GetDefault(RADIUSSERVER *pServer);
  79. // Dialog Data
  80. //{{AFX_DATA(ServerPropDialog)
  81. enum { IDD = IDD_RADIUS_AUTH_CONFIG };
  82. CEdit m_editServerName;
  83. CEdit m_editSecret;
  84. CEdit m_editInterval;
  85. CSpinButtonCtrl m_spinScore;
  86. CSpinButtonCtrl m_spinTimeout;
  87. CEdit m_editPort;
  88. //}}AFX_DATA
  89. // Overrides
  90. // ClassWizard generated virtual function overrides
  91. //{{AFX_VIRTUAL(ServerPropDialog)
  92. public:
  93. protected:
  94. virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
  95. //}}AFX_VIRTUAL
  96. // Implementation
  97. protected:
  98. BOOL m_fEdit; // = TRUE if editing (else we are adding)
  99. UINT m_uAuthPort;
  100. CString m_stSecret;
  101. INT m_cchSecret;
  102. UCHAR m_ucSeed;
  103. CString m_stServer;
  104. UINT m_uTimeout;
  105. int m_iInitScore;
  106. BOOL m_fUseDigitalSignatures;
  107. // The accounting data is also stored here (but not used)
  108. UINT m_uAcctPort;
  109. BOOL m_fAccountingOnOff;
  110. // Generated message map functions
  111. //{{AFX_MSG(ServerPropDialog)
  112. virtual BOOL OnInitDialog();
  113. virtual void OnOK();
  114. afx_msg void OnBtnPassword();
  115. // afx_msg void OnContextMenu(CWnd* pWnd, CPoint point);
  116. // afx_msg BOOL OnHelpInfo(HELPINFO* pHelpInfo);
  117. //}}AFX_MSG
  118. DECLARE_MESSAGE_MAP()
  119. };
  120. /*---------------------------------------------------------------------------
  121. Class: RADIUSSecretDialog
  122. ---------------------------------------------------------------------------*/
  123. class RADIUSSecretDialog : public CBaseDialog
  124. {
  125. // Construction
  126. public:
  127. RADIUSSecretDialog(CWnd* pParent = NULL); // standard constructor
  128. ~RADIUSSecretDialog();
  129. VOID GetSecret(CString *pst, INT *pch, UCHAR *pucSeed);
  130. // Dialog Data
  131. //{{AFX_DATA(RADIUSSecretDialog)
  132. enum { IDD = IDD_CHANGE_SECRET };
  133. CEdit m_editSecretOld;
  134. CEdit m_editSecretNew;
  135. CEdit m_editSecretNewConfirm;
  136. //}}AFX_DATA
  137. // Overrides
  138. // ClassWizard generated virtual function overrides
  139. //{{AFX_VIRTUAL(RADIUSSecretDialog)
  140. public:
  141. protected:
  142. virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
  143. //}}AFX_VIRTUAL
  144. // Implementation
  145. protected:
  146. INT m_cchOldSecret;
  147. CString m_stOldSecret;
  148. UCHAR m_ucOldSeed;
  149. INT m_cchNewSecret;
  150. CString m_stNewSecret;
  151. UCHAR m_ucNewSeed;
  152. // Generated message map functions
  153. //{{AFX_MSG(RADIUSSecretDialog)
  154. virtual BOOL OnInitDialog();
  155. virtual void OnOK();
  156. // afx_msg void OnContextMenu(CWnd* pWnd, CPoint point);
  157. // afx_msg BOOL OnHelpInfo(HELPINFO* pHelpInfo);
  158. //}}AFX_MSG
  159. DECLARE_MESSAGE_MAP()
  160. };
  161. /*---------------------------------------------------------------------------
  162. Class: RouterAuthRadiusConfig
  163. This is the config object for RADIUS.
  164. Author: KennT
  165. ---------------------------------------------------------------------------*/
  166. class RouterAuthRadiusConfig :
  167. public IAuthenticationProviderConfig,
  168. public CComObjectRoot,
  169. public CComCoClass<RouterAuthRadiusConfig, &CLSID_RouterAuthRADIUS>
  170. {
  171. public:
  172. DECLARE_REGISTRY(RouterAuthRadiusConfig,
  173. _T("RouterAuthRadiusConfig.RouterAuthRadiusConfig.1"),
  174. _T("RouterAuthRadiusConfig.RouterAuthRadiusConfig"),
  175. IDS_RADIUS_CONFIG_DESC,
  176. THREADFLAGS_APARTMENT)
  177. BEGIN_COM_MAP(RouterAuthRadiusConfig)
  178. COM_INTERFACE_ENTRY(IAuthenticationProviderConfig) // Must have one static entry
  179. END_COM_MAP()
  180. DECLARE_NOT_AGGREGATABLE(RouterAuthRadiusConfig)
  181. // these must be overridden to provide values to the base class
  182. protected:
  183. DeclareIAuthenticationProviderConfigMembers(IMPL);
  184. };
  185. /*---------------------------------------------------------------------------
  186. Class: RouterAcctRadiusConfig
  187. This is the config object for RADIUS.
  188. Author: KennT
  189. ---------------------------------------------------------------------------*/
  190. class RouterAcctRadiusConfig :
  191. public IAccountingProviderConfig,
  192. public CComObjectRoot,
  193. public CComCoClass<RouterAcctRadiusConfig, &CLSID_RouterAcctRADIUS>
  194. {
  195. public:
  196. DECLARE_REGISTRY(RouterAcctRadiusConfig,
  197. _T("RouterAcctRadiusConfig.RouterAcctRadiusConfig.1"),
  198. _T("RouterAcctRadiusConfig.RouterAcctRadiusConfig"),
  199. IDS_RADIUS_CONFIG_DESC,
  200. THREADFLAGS_APARTMENT)
  201. BEGIN_COM_MAP(RouterAcctRadiusConfig)
  202. COM_INTERFACE_ENTRY(IAccountingProviderConfig) // Must have one static entry
  203. END_COM_MAP()
  204. DECLARE_NOT_AGGREGATABLE(RouterAcctRadiusConfig)
  205. // these must be overridden to provide values to the base class
  206. protected:
  207. DeclareIAccountingProviderConfigMembers(IMPL);
  208. };
  209. /*---------------------------------------------------------------------------
  210. Class: ServerPropAcctDialog
  211. ---------------------------------------------------------------------------*/
  212. class ServerPropAcctDialog : public ServerPropDialog
  213. {
  214. // Construction
  215. public:
  216. ServerPropAcctDialog(BOOL fEdit, CWnd* pParent = NULL); // standard constructor
  217. ~ServerPropAcctDialog();
  218. // Dialog Data
  219. //{{AFX_DATA(ServerPropAcctDialog)
  220. enum { IDD = IDD_RADIUS_ACCT_CONFIG };
  221. //}}AFX_DATA
  222. // Overrides
  223. // ClassWizard generated virtual function overrides
  224. //{{AFX_VIRTUAL(ServerPropAcctDialog)
  225. public:
  226. protected:
  227. virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
  228. //}}AFX_VIRTUAL
  229. // Implementation
  230. // Generated message map functions
  231. //{{AFX_MSG(ServerPropAcctDialog)
  232. virtual BOOL OnInitDialog();
  233. virtual void OnOK();
  234. afx_msg void OnBtnEnable();
  235. // afx_msg void OnContextMenu(CWnd* pWnd, CPoint point);
  236. // afx_msg BOOL OnHelpInfo(HELPINFO* pHelpInfo);
  237. //}}AFX_MSG
  238. DECLARE_MESSAGE_MAP()
  239. };
  240. /*---------------------------------------------------------------------------
  241. Helper functions (for RADIUS registry access)
  242. ---------------------------------------------------------------------------*/
  243. // Do not show UI when loading the RADIUS server
  244. #define RADIUS_FLAG_NOUI (0x00000001)
  245. // Do not do the IP Address lookup
  246. #define RADIUS_FLAG_NOIP (0x00000002)
  247. HRESULT LoadRadiusServers(IN OPTIONAL LPCTSTR pszServerName,
  248. IN HKEY hkeyMachine,
  249. IN BOOL fAuthentication,
  250. IN CRadiusServers * pRadiusServers,
  251. IN DWORD dwFlags);
  252. HRESULT SaveRadiusServers(IN OPTIONAL LPCTSTR pszServerName,
  253. IN HKEY hkeyMachine,
  254. IN BOOL fAuthentication,
  255. IN RADIUSSERVER *pServerRoot);
  256. HRESULT DeleteRadiusServers(IN OPTIONAL LPCTSTR pszServerName,
  257. IN RADIUSSERVER *pServerRoot);