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.

190 lines
4.8 KiB

  1. /**********************************************************************/
  2. /** Microsoft Windows/NT **/
  3. /** Copyright(c) Microsoft Corporation, 1997 - 2002 **/
  4. /**********************************************************************/
  5. /*
  6. Servpp.h
  7. Server properties implementation file
  8. FILE HISTORY:
  9. */
  10. #include "stdafx.h"
  11. #include "QmSApp.h"
  12. #include "spdutil.h"
  13. #ifdef _DEBUG
  14. #define new DEBUG_NEW
  15. #undef THIS_FILE
  16. static char THIS_FILE[] = __FILE__;
  17. #endif
  18. /////////////////////////////////////////////////////////////////////////////
  19. //
  20. // CQmSAProperties holder
  21. //
  22. /////////////////////////////////////////////////////////////////////////////
  23. CQmSAProperties::CQmSAProperties
  24. (
  25. ITFSNode * pNode,
  26. IComponentData * pComponentData,
  27. ITFSComponentData * pTFSCompData,
  28. CQmSA * pSA,
  29. ISpdInfo * pSpdInfo,
  30. LPCTSTR pszSheetName
  31. ) : CPropertyPageHolderBase(pNode, pComponentData, pszSheetName)
  32. {
  33. //ASSERT(pFolderNode == GetContainerNode());
  34. m_bAutoDeletePages = FALSE; // we have the pages as embedded members
  35. AddPageToList((CPropertyPageBase*) &m_pageGeneral);
  36. Assert(pTFSCompData != NULL);
  37. m_spTFSCompData.Set(pTFSCompData);
  38. m_spSpdInfo.Set(pSpdInfo);
  39. m_SA = *pSA;
  40. m_bTheme = TRUE;
  41. }
  42. CQmSAProperties::~CQmSAProperties()
  43. {
  44. RemovePageFromList((CPropertyPageBase*) &m_pageGeneral, FALSE);
  45. }
  46. /////////////////////////////////////////////////////////////////////////////
  47. // CQmSAGenProp property page
  48. IMPLEMENT_DYNCREATE(CQmSAGenProp, CPropertyPageBase)
  49. CQmSAGenProp::CQmSAGenProp() : CPropertyPageBase(CQmSAGenProp::IDD)
  50. {
  51. //{{AFX_DATA_INIT(CQmSAGenProp)
  52. // NOTE: the ClassWizard will add member initialization here
  53. //}}AFX_DATA_INIT
  54. }
  55. CQmSAGenProp::~CQmSAGenProp()
  56. {
  57. }
  58. void CQmSAGenProp::DoDataExchange(CDataExchange* pDX)
  59. {
  60. CPropertyPageBase::DoDataExchange(pDX);
  61. //{{AFX_DATA_MAP(CQmSAGenProp)
  62. //}}AFX_DATA_MAP
  63. }
  64. BEGIN_MESSAGE_MAP(CQmSAGenProp, CPropertyPageBase)
  65. //{{AFX_MSG_MAP(CQmSAGenProp)
  66. //}}AFX_MSG_MAP
  67. END_MESSAGE_MAP()
  68. /////////////////////////////////////////////////////////////////////////////
  69. // CQmSAGenProp message handlers
  70. BOOL CQmSAGenProp::OnInitDialog()
  71. {
  72. CPropertyPageBase::OnInitDialog();
  73. PopulateSAInfo();
  74. SetDirty(FALSE);
  75. return TRUE; // return TRUE unless you set the focus to a control
  76. // EXCEPTION: OCX Property Pages should return FALSE
  77. }
  78. void CQmSAGenProp::PopulateSAInfo()
  79. {
  80. CString st;
  81. CQmSAProperties * pSAProp;
  82. CQmSA * pSA;
  83. CMmFilterInfo * pFltrInfo;
  84. pSAProp = (CQmSAProperties *) GetHolder();
  85. Assert(pSAProp);
  86. pSAProp->GetSAInfo(&pSA);
  87. AddressToString(pSA->m_QmDriverFilter.m_SrcAddr, &st);
  88. GetDlgItem(IDC_QMSA_SRC)->SetWindowText(st);
  89. AddressToString(pSA->m_QmDriverFilter.m_DesAddr, &st);
  90. GetDlgItem(IDC_QMSA_DEST)->SetWindowText(st);
  91. PortToString(pSA->m_QmDriverFilter.m_SrcPort, &st);
  92. GetDlgItem(IDC_QMSA_SRC_PORT)->SetWindowText(st);
  93. PortToString(pSA->m_QmDriverFilter.m_DesPort, &st);
  94. GetDlgItem(IDC_QMSA_DEST_PORT)->SetWindowText(st);
  95. ProtocolToString(pSA->m_QmDriverFilter.m_Protocol, &st);
  96. GetDlgItem(IDC_QMSA_PROT)->SetWindowText(st);
  97. TnlEpToString(pSA->m_QmDriverFilter.m_Type,
  98. pSA->m_QmDriverFilter.m_MyTunnelEndpt,
  99. &st);
  100. GetDlgItem(IDC_QMSA_ME_TNL)->SetWindowText(st);
  101. TnlEpToString(pSA->m_QmDriverFilter.m_Type,
  102. pSA->m_QmDriverFilter.m_PeerTunnelEndpt,
  103. &st);
  104. GetDlgItem(IDC_QMSA_PEER_TNL)->SetWindowText(st);
  105. st = pSA->m_stPolicyName;
  106. if ( pSA->m_dwPolFlags & IPSEC_QM_POLICY_DEFAULT_POLICY )
  107. {
  108. AfxFormatString1(st, IDS_POL_DEFAULT_RESPONSE, (LPCTSTR) pSA->m_stPolicyName);
  109. }
  110. GetDlgItem(IDC_QMSA_NEGPOL)->SetWindowText(st);
  111. QmAlgorithmToString(QM_ALGO_AUTH, &pSA->m_SelectedOffer, &st);
  112. GetDlgItem(IDC_QMSA_AUTH)->SetWindowText(st);
  113. QmAlgorithmToString(QM_ALGO_ESP_CONF, &pSA->m_SelectedOffer, &st);
  114. GetDlgItem(IDC_QMSA_ESP_CONF)->SetWindowText(st);
  115. QmAlgorithmToString(QM_ALGO_ESP_INTEG, &pSA->m_SelectedOffer, &st);
  116. GetDlgItem(IDC_QMSA_ESP_INTEG)->SetWindowText(st);
  117. KeyLifetimeToString(pSA->m_SelectedOffer.m_Lifetime, &st);
  118. GetDlgItem(IDC_QMSA_KEYLIFE)->SetWindowText(st);
  119. BoolToString(pSA->m_SelectedOffer.m_fPFSRequired, &st);
  120. GetDlgItem(IDC_QMSA_PFS_ENABLE)->SetWindowText(st);
  121. PFSGroupToString(pSA->m_SelectedOffer.m_dwPFSGroup, &st);
  122. GetDlgItem(IDC_QMSA_PFS_GRP)->SetWindowText(st);
  123. }
  124. BOOL CQmSAGenProp::OnApply()
  125. {
  126. if (!IsDirty())
  127. return TRUE;
  128. UpdateData();
  129. //TODO
  130. //Do nothing at this time
  131. //CPropertyPageBase::OnApply();
  132. return TRUE;
  133. }
  134. BOOL CQmSAGenProp::OnPropertyChange(BOOL bScope, LONG_PTR *ChangeMask)
  135. {
  136. return FALSE;
  137. }