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.

184 lines
4.5 KiB

  1. /**********************************************************************/
  2. /** Microsoft Windows/NT **/
  3. /** Copyright(c) Microsoft Corporation, 1997 - 1999 **/
  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. }
  41. CQmSAProperties::~CQmSAProperties()
  42. {
  43. RemovePageFromList((CPropertyPageBase*) &m_pageGeneral, FALSE);
  44. }
  45. /////////////////////////////////////////////////////////////////////////////
  46. // CQmSAGenProp property page
  47. IMPLEMENT_DYNCREATE(CQmSAGenProp, CPropertyPageBase)
  48. CQmSAGenProp::CQmSAGenProp() : CPropertyPageBase(CQmSAGenProp::IDD)
  49. {
  50. //{{AFX_DATA_INIT(CQmSAGenProp)
  51. // NOTE: the ClassWizard will add member initialization here
  52. //}}AFX_DATA_INIT
  53. }
  54. CQmSAGenProp::~CQmSAGenProp()
  55. {
  56. }
  57. void CQmSAGenProp::DoDataExchange(CDataExchange* pDX)
  58. {
  59. CPropertyPageBase::DoDataExchange(pDX);
  60. //{{AFX_DATA_MAP(CQmSAGenProp)
  61. //}}AFX_DATA_MAP
  62. }
  63. BEGIN_MESSAGE_MAP(CQmSAGenProp, CPropertyPageBase)
  64. //{{AFX_MSG_MAP(CQmSAGenProp)
  65. //}}AFX_MSG_MAP
  66. END_MESSAGE_MAP()
  67. /////////////////////////////////////////////////////////////////////////////
  68. // CQmSAGenProp message handlers
  69. BOOL CQmSAGenProp::OnInitDialog()
  70. {
  71. CPropertyPageBase::OnInitDialog();
  72. PopulateSAInfo();
  73. SetDirty(FALSE);
  74. return TRUE; // return TRUE unless you set the focus to a control
  75. // EXCEPTION: OCX Property Pages should return FALSE
  76. }
  77. void CQmSAGenProp::PopulateSAInfo()
  78. {
  79. CString st;
  80. CQmSAProperties * pSAProp;
  81. CQmSA * pSA;
  82. CMmFilterInfo * pFltrInfo;
  83. pSAProp = (CQmSAProperties *) GetHolder();
  84. Assert(pSAProp);
  85. pSAProp->GetSAInfo(&pSA);
  86. AddressToString(pSA->m_QmDriverFilter.m_SrcAddr, &st);
  87. GetDlgItem(IDC_QMSA_SRC)->SetWindowText(st);
  88. AddressToString(pSA->m_QmDriverFilter.m_DesAddr, &st);
  89. GetDlgItem(IDC_QMSA_DEST)->SetWindowText(st);
  90. PortToString(pSA->m_QmDriverFilter.m_SrcPort, &st);
  91. GetDlgItem(IDC_QMSA_SRC_PORT)->SetWindowText(st);
  92. PortToString(pSA->m_QmDriverFilter.m_DesPort, &st);
  93. GetDlgItem(IDC_QMSA_DEST_PORT)->SetWindowText(st);
  94. ProtocolToString(pSA->m_QmDriverFilter.m_Protocol, &st);
  95. GetDlgItem(IDC_QMSA_PROT)->SetWindowText(st);
  96. TnlEpToString(pSA->m_QmDriverFilter.m_Type,
  97. pSA->m_QmDriverFilter.m_MyTunnelEndpt,
  98. &st);
  99. GetDlgItem(IDC_QMSA_ME_TNL)->SetWindowText(st);
  100. TnlEpToString(pSA->m_QmDriverFilter.m_Type,
  101. pSA->m_QmDriverFilter.m_PeerTunnelEndpt,
  102. &st);
  103. GetDlgItem(IDC_QMSA_PEER_TNL)->SetWindowText(st);
  104. GetDlgItem(IDC_QMSA_NEGPOL)->SetWindowText(pSA->m_stPolicyName);
  105. QmAlgorithmToString(QM_ALGO_AUTH, &pSA->m_SelectedOffer, &st);
  106. GetDlgItem(IDC_QMSA_AUTH)->SetWindowText(st);
  107. QmAlgorithmToString(QM_ALGO_ESP_CONF, &pSA->m_SelectedOffer, &st);
  108. GetDlgItem(IDC_QMSA_ESP_CONF)->SetWindowText(st);
  109. QmAlgorithmToString(QM_ALGO_ESP_INTEG, &pSA->m_SelectedOffer, &st);
  110. GetDlgItem(IDC_QMSA_ESP_INTEG)->SetWindowText(st);
  111. KeyLifetimeToString(pSA->m_SelectedOffer.m_Lifetime, &st);
  112. GetDlgItem(IDC_QMSA_KEYLIFE)->SetWindowText(st);
  113. BoolToString(pSA->m_SelectedOffer.m_fPFSRequired, &st);
  114. GetDlgItem(IDC_QMSA_PFS_ENABLE)->SetWindowText(st);
  115. st.Format(_T("%d"), pSA->m_SelectedOffer.m_dwPFSGroup);
  116. GetDlgItem(IDC_QMSA_PFS_GRP)->SetWindowText(st);
  117. }
  118. BOOL CQmSAGenProp::OnApply()
  119. {
  120. if (!IsDirty())
  121. return TRUE;
  122. UpdateData();
  123. //TODO
  124. //Do nothing at this time
  125. //CPropertyPageBase::OnApply();
  126. return TRUE;
  127. }
  128. BOOL CQmSAGenProp::OnPropertyChange(BOOL bScope, LONG_PTR *ChangeMask)
  129. {
  130. return FALSE;
  131. }